home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / mh / updates / MH.6.8.3.Z / MH.6.8.3
Encoding:
Text File  |  1993-11-29  |  120.4 KB  |  4,881 lines

  1. *** ../mh-6.8.2/Patchlevel    Wed Aug 25 15:56:06 1993
  2. --- Patchlevel    Tue Nov 30 13:21:56 1993
  3. ***************
  4. *** 1 ****
  5. ! MH.6.8 patch.2
  6. --- 1 ----
  7. ! MH.6.8 patch.3
  8. *** ../mh-6.8.2/conf/config/config.c    Wed Aug 25 16:00:37 1993
  9. --- conf/config/config.c    Wed Sep  1 15:29:18 1993
  10. ***************
  11. *** 1,6 ****
  12.   /* config.c - master MH configuration file */
  13.   #ifndef    lint
  14. ! static char ident[] = "@(#)$Id: config.c,v 1.9 1992/11/05 16:59:39 jromine Exp $";
  15.   #endif    /* lint */
  16.   
  17.   /* @(MHWARNING) */
  18. --- 1,6 ----
  19.   /* config.c - master MH configuration file */
  20.   #ifndef    lint
  21. ! static char ident[] = "@(#)$Id: config.c,v 1.11 1993/09/01 22:29:10 jromine Exp $";
  22.   #endif    /* lint */
  23.   
  24.   /* @(MHWARNING) */
  25. ***************
  26. *** 125,130 ****
  27. --- 125,131 ----
  28.   char   *rcvdistcomps = "rcvdistcomps";
  29.   char   *replcomps = "replcomps";
  30.   char   *usequence = "Unseen-Sequence";
  31. + char   *mhlibdir = "@(MHETCPATH)";    /* NB: this will change */
  32.   
  33.   
  34.   /* 
  35. *** ../mh-6.8.2/conf/config/mts.c    Wed Aug 25 16:00:36 1993
  36. --- conf/config/mts.c    Wed Sep  1 13:57:16 1993
  37. ***************
  38. *** 1,6 ****
  39.   /* mts.c - definitions for the mail transport system */
  40.   #ifndef    lint
  41. ! static char ident[] = "@(#)$Id: mts.c,v 2.18 1993/08/19 23:36:12 jromine Exp $";
  42.   #endif /* lint */
  43.   
  44.   /* LINTLIBRARY */
  45. --- 1,6 ----
  46.   /* mts.c - definitions for the mail transport system */
  47.   #ifndef    lint
  48. ! static char ident[] = "@(#)$Id: mts.c,v 2.19 1993/09/01 20:55:38 jromine Exp jromine $";
  49.   #endif /* lint */
  50.   
  51.   /* LINTLIBRARY */
  52. ***************
  53. *** 125,130 ****
  54. --- 125,131 ----
  55.   
  56.   /* SMTP/POP stuff */
  57.   
  58. + char   *clientname = "";
  59.   char   *servers = "localhost \01localnet";
  60.   char   *pophost = "";
  61.   
  62. ***************
  63. *** 201,206 ****
  64. --- 202,208 ----
  65.       "sendmail", &sendmail,
  66.   #endif /* SENDMTS */
  67.   
  68. +     "clientname",  &clientname,
  69.       "servers", &servers,
  70.       "pophost", &pophost,
  71.   
  72. *** ../mh-6.8.2/conf/doc/folder.rf    Wed Aug 25 16:00:28 1993
  73. --- conf/doc/folder.rf    Fri Aug 27 11:13:56 1993
  74. ***************
  75. *** 1,3 ****
  76.   .\"    @(MHWARNING)
  77. ! .\" @(#)$Id: folder.rf,v 1.12 1993/08/19 21:20:51 jromine Exp $
  78.   .SC FOLDER 1
  79. --- 1,3 ----
  80.   .\"    @(MHWARNING)
  81. ! .\" @(#)$Id: folder.rf,v 1.15 1993/08/27 18:13:47 jromine Exp $
  82.   .SC FOLDER 1
  83. ***************
  84. *** 9,10 ****
  85. --- 9,11 ----
  86.   \%[\-all]
  87. + \%[\-create] \%[\-nocreate]
  88.   \%[\-print]
  89. ***************
  90. *** 43,50 ****
  91.   become the current folder and/or message.
  92. - If the specified (or default) folder doesn't exist,
  93. - the user will be queried as to whether the folder should be created.
  94. - When standard input is not a tty, the folder is
  95. - created without any query.
  96. - (This is the easy way to create an empty folder for use later.)
  97.   By comparison,
  98. --- 44,45 ----
  99. ***************
  100. *** 55,56 ****
  101. --- 50,63 ----
  102.   
  103. + If the specified (or default) folder doesn't exist,
  104. + the default action is to query the user
  105. + as to whether the folder should be created;
  106. + when standard input is not a tty, the answer to 
  107. + the query is assumed to be \*(lqyes\*(rq.
  108. + Specifying `\-create' will cause \fIfolder\fP to create
  109. + new folders without any query.
  110. + (This is the easy way to create an empty folder for use later.)
  111. + Specifying `\-nocreate' will 
  112. + cause \fIfolder\fP to exit without creating a non-existant folder.
  113. + .\"
  114.   .\" note - this doesn't work at present
  115. ***************
  116. *** 60,62 ****
  117.   .\" but the folder summary will not be printed.
  118.   .Uh "Multiple Folders"
  119. --- 67,68 ----
  120. ***************
  121. *** 199,200 ****
  122. --- 205,210 ----
  123.   `\-all' forces `\-header' and `\-total'.
  124. + .sp
  125. + There is no way to restore the default behavior 
  126. + (to ask the user whether to create a non-existant folder)
  127. + after `\-create' or `\-nocreate' is given.
  128.   .En
  129. *** ../mh-6.8.2/conf/doc/mh-chart.rf    Wed Aug 25 16:00:24 1993
  130. --- conf/doc/mh-chart.rf    Tue Oct 26 13:12:49 1993
  131. ***************
  132. *** 1,3 ****
  133.   .\"    @(MHWARNING)
  134. ! .\" @(#)$Id: mh-chart.rf,v 2.19 1993/08/20 17:13:30 jromine Exp $
  135.   .if '\*(ZZ'-man' \{\
  136. --- 1,3 ----
  137.   .\"    @(MHWARNING)
  138. ! .\" @(#)$Id: mh-chart.rf,v 2.25 1993/10/26 20:12:45 jromine Exp $
  139.   .if '\*(ZZ'-man' \{\
  140. ***************
  141. *** 238,241 ****
  142.   mhn
  143. ! \%[+folder] \%[msgs] \%[\-part\0number]... \%[\-type\0content]...
  144.   .br
  145.   \%[\-list\0\%[\-headers]\0\%[\-noheaders]
  146. --- 238,243 ----
  147.   mhn
  148. ! \%[\%[+folder] \%[msgs] | \%[\-file\0file]]
  149.   .br
  150. + \%[\-part\0number]... \%[\-type\0content]...
  151. + .br
  152.   \%[\-list\0\%[\-headers]\0\%[\-noheaders]
  153. ***************
  154. *** 250,256 ****
  155.   .br
  156. ! \%[\-cache\0policy]
  157.   \%[\-check]\0\%[\-nocheck]
  158.   \%[\-ebcdicsafe]\0\%[\-noebcdicsafe]
  159.   \%[\-rfc934mode]\0\%[\-norfc934mode]
  160.   \%[\-verbose]\0\%[\-noverbose]
  161.   \%[\-help]
  162. --- 252,263 ----
  163.   .br
  164. ! \%[\-cache] \%[\-nocache] \%[\-rcache\0policy] \%[\-wcache\0policy]
  165. ! .br
  166.   \%[\-check]\0\%[\-nocheck]
  167. + .br
  168.   \%[\-ebcdicsafe]\0\%[\-noebcdicsafe]
  169. + .br
  170.   \%[\-rfc934mode]\0\%[\-norfc934mode]
  171. + .br
  172.   \%[\-verbose]\0\%[\-noverbose]
  173. + .br
  174.   \%[\-help]
  175. *** ../mh-6.8.2/conf/doc/mh-tailor.rf    Wed Aug 25 16:00:26 1993
  176. --- conf/doc/mh-tailor.rf    Tue Nov 30 14:06:47 1993
  177. ***************
  178. *** 1,3 ****
  179.   .\"    @(MHWARNING)
  180. ! .\" @(#)$Id: mh-tailor.rf,v 2.19 1992/12/02 22:16:12 jromine Exp $
  181.   .SC MH-TAILOR 5
  182. --- 1,3 ----
  183.   .\"    @(MHWARNING)
  184. ! .\" @(#)$Id: mh-tailor.rf,v 2.20 1993/09/01 21:20:56 jromine Exp $
  185.   .SC MH-TAILOR 5
  186. ***************
  187. *** 29,31 ****
  188.   This has no equivalent in the \fIMH\fR configuration file.
  189. ! POP client hosts have this value set to the name of the POP service host.
  190.   
  191. --- 29,31 ----
  192.   This has no equivalent in the \fIMH\fR configuration file.
  193. ! POP client hosts should set this value to the name of the POP service host.
  194.   
  195. ***************
  196. *** 43,44 ****
  197. --- 43,59 ----
  198.   .ti -.5i
  199. + clientname:
  200. + .br
  201. + The host name \fIMH\fP will give in the
  202. + SMTP \fBHELO\fP (and \fBEHLO\fP) command, when posting mail.
  203. + If not set, no \fBHELO\fP command will be given.
  204. + Although the \fBHELO\fP command is required by RFC 821, 
  205. + many SMTP servers do not require it.
  206. + .sp
  207. + Early versions of SendMail will fail if the host name
  208. + given in the \fBHELO\fP command is the local host; 
  209. + later versions of SendMail will complain if you omit the
  210. + \fBHELO\fP command.  If you run SendMail, find out what
  211. + your system expects and set this field accordingly.
  212. + .ti -.5i
  213.   systemname:
  214. ***************
  215. *** 338,339 ****
  216. --- 353,355 ----
  217.   .in -.5i
  218. + .if n .ne 8
  219.   .Uh "BBoards & The NNTP"
  220. *** ../mh-6.8.2/conf/doc/mhn.rf    Wed Aug 25 16:00:13 1993
  221. --- conf/doc/mhn.rf    Tue Oct 26 13:13:03 1993
  222. ***************
  223. *** 1,3 ****
  224.   .\"    @(MHWARNING)
  225. ! .\" @(#)$Id: mhn.rf,v 1.9 1993/08/20 15:42:08 jromine Exp $
  226.   .SC MHN 1
  227. --- 1,3 ----
  228.   .\"    @(MHWARNING)
  229. ! .\" @(#)$Id: mhn.rf,v 1.14 1993/10/26 20:12:56 jromine Exp $
  230.   .SC MHN 1
  231. ***************
  232. *** 7,10 ****
  233.   mhn
  234. ! \%[+folder] \%[msgs] \%[\-part\0number]... \%[\-type\0content]...
  235.   .br
  236.   \%[\-list\0\%[\-headers]\0\%[\-noheaders]
  237. --- 7,12 ----
  238.   mhn
  239. ! \%[\%[+folder] \%[msgs] | \%[\-file\0file]]
  240.   .br
  241. + \%[\-part\0number]... \%[\-type\0content]...
  242. + .br
  243.   \%[\-list\0\%[\-headers]\0\%[\-noheaders]
  244. ***************
  245. *** 19,21 ****
  246.   .br
  247. ! \%[\-cache\0policy]
  248.   .br
  249. --- 21,23 ----
  250.   .br
  251. ! \%[\-cache] \%[\-nocache] \%[\-rcache\0policy] \%[\-wcache\0policy]
  252.   .br
  253. ***************
  254. *** 32,37 ****
  255.   The \fImhn\fR command manipulates multi-media messages as specified in
  256. ! RFC 1341.
  257.   
  258. ! Three action switches direct the operation of \fImhn\fR,
  259. ! namely `\-list', `\-show', and `\-store'.
  260.   Any of these switches may be used concurrently.
  261. --- 34,39 ----
  262.   The \fImhn\fR command manipulates multi-media messages as specified in
  263. ! RFC 1521.
  264.   
  265. ! Four action switches direct the operation of \fImhn\fR,
  266. ! namely `\-list', `\-show', `\-store', and `-cache'.
  267.   Any of these switches may be used concurrently.
  268. ***************
  269. *** 58,60 ****
  270.   The initial list of \*(lqstandard\*(rq content types and subtypes can be found
  271. ! in RFC 1341.
  272.   .ne 18
  273. --- 60,62 ----
  274.   The initial list of \*(lqstandard\*(rq content types and subtypes can be found
  275. ! in RFC 1521.
  276.   .ne 18
  277. ***************
  278. *** 67,69 ****
  279.   ----    --------
  280. ! text    plain, richtext
  281.   multipart    mixed, alternative, digest, parallel
  282. --- 69,71 ----
  283.   ----    --------
  284. ! text    plain
  285.   multipart    mixed, alternative, digest, parallel
  286. ***************
  287. *** 90,92 ****
  288.   Note that regardless of the values given to the `\-type' switch,
  289. ! a multipart content is always acted upon.
  290.   Further note that if the `\-type' switch is used,
  291. --- 92,94 ----
  292.   Note that regardless of the values given to the `\-type' switch,
  293. ! a multipart content (of any subtype listed above) is always acted upon.
  294.   Further note that if the `\-type' switch is used,
  295. ***************
  296. *** 100,101 ****
  297. --- 102,112 ----
  298.   
  299. + The option `\-file\ file' directs \fImhn\fR to use the specified
  300. + file as the source message, rather than a message from
  301. + a folder.
  302. + Note that the file should be a validly formatted message,
  303. + just like any other \fIMH\fR message.
  304. + It should \fBNOT\fR be in mail drop format
  305. + (to convert a file in mail drop format to a folder of \fIMH\fR messages,
  306. + see \fIinc\fR\0(1)).
  307.   .Uh "Listing the Contents"
  308. ***************
  309. *** 134,135 ****
  310. --- 145,147 ----
  311.   %s    subtype
  312. + %d    content description
  313.   .re
  314. ***************
  315. *** 152,153 ****
  316. --- 164,172 ----
  317.   
  318. + Note that if the content being displayed is multipart,
  319. + but not one of the subtypes listed above,
  320. + then the f- and F-escapes expand to multiple filenames,
  321. + one for each subordinate content.
  322. + Further,
  323. + stdin is not redirected from the terminal to the content.
  324.   First,
  325. ***************
  326. *** 262,264 ****
  327.   current message have terminated.
  328. ! In the case of a multipart content,
  329.   the content contains advice indicating if the parts should be
  330. --- 281,283 ----
  331.   current message have terminated.
  332. ! In the case of a multipart content (of any subtype listed above),
  333.   the content contains advice indicating if the parts should be
  334. ***************
  335. *** 278,279 ****
  336. --- 297,299 ----
  337.   profile entry,
  338. + .ne 6
  339.   e.g.,
  340. ***************
  341. *** 304,306 ****
  342.   .sp
  343. ! If the content isn't part of a multipart content,
  344.   the p-escapes are ignored.
  345. --- 324,326 ----
  346.   .sp
  347. ! If the content isn't part of a multipart (of any subtype listed above) content,
  348.   the p-escapes are ignored.
  349. ***************
  350. *** 405,407 ****
  351.   .sp
  352. ! If your system supports a SOCKETs interface to TCP/IP,
  353.   then \fImhn\fR will use a built-in FTP client.
  354. --- 425,428 ----
  355.   .sp
  356. ! For the \*(lqanon-ftp\*(rq and \*(lqftp\*(rq access types,
  357. ! if your system supports a SOCKETs interface to TCP/IP,
  358.   then \fImhn\fR will use a built-in FTP client.
  359. ***************
  360. *** 409,410 ****
  361. --- 430,432 ----
  362.   \fImhn\fR will look for the \fBmhn-access-ftp\fR profile entry,
  363. + .ne 6
  364.   e.g.,
  365. ***************
  366. *** 432,434 ****
  367.   The program should terminate with a zero-valued exit-status if the
  368. ! retrieval is success.
  369.   
  370. --- 454,456 ----
  371.   The program should terminate with a zero-valued exit-status if the
  372. ! retrieval is successful.
  373.   
  374. ***************
  375. *** 438,448 ****
  376.   and if the content allows caching,
  377. ! then \fImhn\fR looks for the profile entry \fBmhn-cache\fR to
  378. ! determine if the content should be read from/written to a cache.
  379. ! Any content written to the cache will,
  380. ! by default,
  381. ! be world-readable.
  382. ! (To prevent this,
  383. ! use a directory name with the desired read and execute permissions.)
  384. ! The \fBmhn-cache\fR profile entry names the directory used for caching,
  385. ! e.g.,
  386.   .sp
  387. --- 460,491 ----
  388.   and if the content allows caching,
  389. ! then depending on the caching behavior of \fImhn\fR,
  390. ! the content might be read from or written to a cache.
  391. ! The caching behavior of \fImhn\fR is controlled with
  392. ! the `\-rcache' and `\-wcache' switches,
  393. ! which define the policy for reading from,
  394. ! and writing to,
  395. ! the cache, respectively.
  396. ! One of four policies may be specified:
  397. ! \*(lqpublic\*(rq,
  398. ! indicating that \fImhn\fR should make use of a
  399. ! publically-accessible content cache;
  400. ! \*(lqprivate\*(rq,
  401. ! indicating that \fImhn\fR should make use of the user's
  402. ! private content cache;
  403. ! \*(lqnever\*(rq,
  404. ! indicating that \fImhn\fR should never make use of caching;
  405. ! and,
  406. ! \*(lqask\*(rq,
  407. ! indicating that \fImhn\fR should ask the user.
  408. ! There are two directories where contents may be cached:
  409. ! the profile entry \fBmhn-cache\fR names a directory containing
  410. ! world-readable contents,
  411. ! and,
  412. ! the profile entry \fBmhn-private-cache\fR names a directory containing
  413. ! private contents.
  414. ! The former should be an absolute (rooted) directory name.
  415. ! .ne 6
  416. ! For example,
  417.   .sp
  418. ***************
  419. *** 454,463 ****
  420.   of the system.
  421.   
  422. ! The caching behavior of \fImhn\fR is controlled with the `\-cache' switch.
  423. ! One of three arguments may be specified:
  424. ! always, indicating that \fImhn\fR should make use of caching whenever possible;
  425. ! ask, indicating that \fImhn\fR should ask the user;
  426. ! and,
  427. ! never, indicating that \fImhn\fR should never make use of caching.
  428.   
  429.   .Uh "Composing the Contents"
  430. --- 497,561 ----
  431.   of the system.
  432. + The latter is interpreted relative to the user's MH directory,
  433. + if not rooted,
  434. + .ne 6
  435. + e.g.,
  436. + .sp
  437. + .in +.5i
  438. + mhn-private-cache: .cache
  439. + .in -.5i
  440. + .sp
  441. + (which is the default value).
  442.   
  443. ! .Uh "Caching the Contents"
  444. ! When you encounter a content of type message/external-body with access type
  445. ! \*(lqmail-server\*(rq,
  446. ! \fImhn\fR will ask you if may send a message to a mail-server
  447. ! requesting the content,
  448. ! .ne 14
  449. ! e.g.,
  450. ! .sp
  451. ! .nf
  452. ! .in +.5i
  453. ! % show 1
  454. ! Retrieve content by asking mail-server@...
  455.   
  456. + SEND file
  457. + ? yes
  458. + mhn: request sent
  459. + .in -.5i
  460. + .fi
  461. + .sp
  462. + Regardless of your decision,
  463. + \fImhn\fR can't perform any other processing on the content.
  464. + However,
  465. + if \fImhn\fR is allowed to request the content,
  466. + then when it arrives,
  467. + there should be a top-level \*(lqContent-ID:\*(rq field which
  468. + corresponds to the value in the original message/external-body content.
  469. + You should now use the `-cache' switch to tell \fImhn\fR to enter the
  470. + arriving content into the content cache,
  471. + .ne 8
  472. + e.g.,
  473. + .sp
  474. + .nf
  475. + .in +.5i
  476. + % mhn -cache 2
  477. + caching message 2 as file ...
  478. + .in -.5i
  479. + .fi
  480. + .sp
  481. + You can then re-process the original message/external-body content,
  482. + and \*(lqthe right thing should happen\*(rq,
  483. + .ne 8
  484. + e.g.,
  485. + .sp
  486. + .nf
  487. + .in +.5i
  488. + % show 1
  489. + \0...
  490. + .in -.5i
  491. + .fi
  492.   .Uh "Composing the Contents"
  493. ***************
  494. *** 469,471 ****
  495.   
  496. ! .ne 54
  497.   The syntax of this is straight-forward:
  498. --- 567,569 ----
  499.   
  500. ! .ne 59
  501.   The syntax of this is straight-forward:
  502. ***************
  503. *** 481,482 ****
  504. --- 579,581 ----
  505.                               [ "(" comment ")" ]
  506. +                             [ "<" id ">" ]
  507.                               [ "[" description "]" ]
  508. ***************
  509. *** 488,489 ****
  510. --- 587,589 ----
  511.                               [ "(" comment ")" ]
  512. +                             [ "<" id ">" ]
  513.                               [ "[" description "]" ]
  514. ***************
  515. *** 493,494 ****
  516. --- 593,595 ----
  517.                         | "#forw"
  518. +                             [ "<" id ">" ]
  519.                               [ "[" description "]" ]
  520. ***************
  521. *** 498,499 ****
  522. --- 599,601 ----
  523.                         | "#begin"
  524. +                               [ "<" id ">" ]
  525.                                 [ "[" description "]" ]
  526. ***************
  527. *** 500,502 ****
  528.                                 [   "alternative"
  529. !                                 | "parallel"    ]
  530.                                 EOL
  531. --- 602,605 ----
  532.                                 [   "alternative"
  533. !                                 | "parallel"
  534. !                                 | something-else    ]
  535.                                 EOL
  536. ***************
  537. *** 539,541 ****
  538.       type=tar; \\
  539. !     conversions=x-compress
  540.   .in -.5i
  541. --- 642,644 ----
  542.       type=tar; \\
  543. !     x-conversions=compress
  544.   .in -.5i
  545. ***************
  546. *** 624,626 ****
  547.       type=tar; \\
  548. !     conversions=x-compress [] \\
  549.       access-type=anon-ftp; \\
  550. --- 727,729 ----
  551.       type=tar; \\
  552. !     x-conversions=compress [] \\
  553.       access-type=anon-ftp; \\
  554. ***************
  555. *** 635,637 ****
  556.   and the start of the external-parameters is identified.
  557. ! .ne 16
  558.   These parameters are of the form:
  559. --- 738,740 ----
  560.   and the start of the external-parameters is identified.
  561. ! .ne 19
  562.   These parameters are of the form:
  563. ***************
  564. *** 685,686 ****
  565. --- 788,794 ----
  566.   the \*(lq[\*(rq character and the \*(lq]\*(rq character.
  567. + By default,
  568. + \fImhn\fR will generate a unique \*(lqContent-ID:\*(rq for each directive;
  569. + however,
  570. + the user may override this by defining the ID using the
  571. + \*(lq<\*(rq and \*(lq>\*(rq characters.
  572.   Putting this all together,
  573. ***************
  574. *** 713,714 ****
  575. --- 821,823 ----
  576.   simply double it,
  577. + .ne 6
  578.   e.g.,
  579. ***************
  580. *** 875,876 ****
  581. --- 984,986 ----
  582.   then it is interpreted as the number of seconds to pause in between postings,
  583. + .ne 6
  584.   e.g.,
  585. ***************
  586. *** 908,910 ****
  587.                type=tar
  588. !              conversions=x-compress
  589.   % mhn -show last
  590. --- 1018,1020 ----
  591.                type=tar
  592. !              x-conversions=compress
  593.   % mhn -show last
  594. ***************
  595. *** 938,940 ****
  596.                type=tar
  597. !              conversions=x-compress
  598.   % mhn -show last
  599. --- 1048,1050 ----
  600.                type=tar
  601. !              x-conversions=compress
  602.   % mhn -show last
  603. ***************
  604. *** 978,979 ****
  605. --- 1088,1090 ----
  606.   \fImhn\fR will attempt to consult one other additional user profile,
  607. + .ne 6
  608.   e.g.,
  609. ***************
  610. *** 999,1001 ****
  611.   .Ps
  612. ! ^mhn-cache~^Directory to store cached external contents
  613.   .Ps
  614. --- 1110,1112 ----
  615.   .Ps
  616. ! ^mhn-cache~^Public directory to store cached external contents
  617.   .Ps
  618. ***************
  619. *** 1005,1006 ****
  620. --- 1116,1119 ----
  621.   .Ps
  622. + ^mhn-private-cache~^Personal directory to store cached external contents
  623. + .Ps
  624.   ^mhn-show-<type>*~^Template for displaying contents
  625. ***************
  626. *** 1017,1019 ****
  627.   Internet Message Bodies\fR
  628. ! (RFC 1341),
  629.   .br
  630. --- 1130,1132 ----
  631.   Internet Message Bodies\fR
  632. ! (RFC 1521),
  633.   .br
  634. ***************
  635. *** 1024,1025 ****
  636. --- 1137,1140 ----
  637.   .Ds
  638. + `msgs' defaults to cur
  639. + .Ds
  640.   `\-noauto'
  641. ***************
  642. *** 1026,1028 ****
  643.   .Ds
  644. ! `\-cache\0ask'
  645.   .Ds
  646. --- 1141,1143 ----
  647.   .Ds
  648. ! `\-nocache'
  649.   .Ds
  650. ***************
  651. *** 1038,1039 ****
  652. --- 1153,1156 ----
  653.   .Ds
  654. + `\-rcache\0ask'
  655. + .Ds
  656.   `\-realsize'
  657. ***************
  658. *** 1047,1048 ****
  659. --- 1164,1167 ----
  660.   `\-noverbose'
  661. + .Ds
  662. + `\-wcache\0ask'
  663.   .Co
  664. *** ../mh-6.8.2/conf/doc/show.rf    Wed Aug 25 16:00:15 1993
  665. --- conf/doc/show.rf    Tue Oct 26 13:09:12 1993
  666. ***************
  667. *** 1,3 ****
  668.   .\"    @(MHWARNING)
  669. ! .\" @(#)$Id: show.rf,v 1.7 1992/05/19 21:57:39 jromine Exp $
  670.   .SC SHOW 1
  671. --- 1,3 ----
  672.   .\"    @(MHWARNING)
  673. ! .\" @(#)$Id: show.rf,v 1.8 1993/10/26 20:09:07 jromine Exp $
  674.   .SC SHOW 1
  675. ***************
  676. *** 35,42 ****
  677.   
  678. ! If you have messages with multi-media content,
  679. ! you should define the profile entry \fImhnproc\fR,
  680. ! which is the name of a program to manipulate multi-media messages.
  681. ! The \fImhn\fR\0(1) program is suitable for this purpose.
  682. ! Note that if the \fImhnproc\fR profile entry is defined,
  683. ! the `\-noshowproc' option is NOT specified,
  684.   and if one or more named messages has a multi-media content,
  685. --- 35,43 ----
  686.   
  687. ! If you have messages with multi-media contents,
  688. ! the profile entry \fImhnproc\fR defines the name of a program to
  689. ! manipulate multi-media messages.
  690. ! (The \fImhn\fR\0(1) program,
  691. ! which is suitable for this purpose,
  692. ! is the default.)
  693. ! If the `\-noshowproc' option is NOT specified,
  694.   and if one or more named messages has a multi-media content,
  695. ***************
  696. *** 46,47 ****
  697. --- 47,52 ----
  698.   environment variable \fB$NOMHNPROC\fR is set.
  699. + Note that the \fImhnproc\fR may be invoked even for textual contents,
  700. + depending on the character set involved.
  701. + The environment variable $MM_CHARSET should be set to the terminal's
  702. + character set to avoid gratuitous invocations of the \fImhnproc\fR.
  703.   @END: MIME
  704. *** ../mh-6.8.2/conf/doc/sortm.rf    Wed Aug 25 16:00:15 1993
  705. --- conf/doc/sortm.rf    Fri Aug 27 13:21:30 1993
  706. ***************
  707. *** 1,3 ****
  708.   .\"    @(MHWARNING)
  709. ! .\" @(#)$Id: sortm.rf,v 1.8 90/04/05 15:15:26 sources Exp $
  710.   .SC SORTM 1
  711. --- 1,3 ----
  712.   .\"    @(MHWARNING)
  713. ! .\" @(#)$Id: sortm.rf,v 1.9 1993/08/27 20:21:19 jromine Exp $
  714.   .SC SORTM 1
  715. ***************
  716. *** 80,88 ****
  717.   
  718. ! Previously,
  719. ! \fIsortm\fR would try to fill any gaps in a folder within the
  720. ! range of messages it sorted. 
  721. ! To improve performance,
  722. ! \fIsortm\fR now minimizes the number of message moves.
  723. ! To pack a folder, use
  724. ! \*(lq\fIfolder\ \-pack\fR\|\*(rq instead.
  725.   .Bu
  726. --- 80,88 ----
  727.   
  728. ! \fISortm\fP sometimes did not preserve the message
  729. ! numbering in a folder (e.g., messages
  730. ! 1, 3, and 5, might have been renumbered
  731. ! to 1, 2, 3 after sorting).
  732. ! This was a bug, and has been fixed.
  733. ! To compress the message numbering in a folder, use
  734. ! \*(lq\fIfolder\ \-pack\fR\|\*(rq as always.
  735.   .Bu
  736. *** ../mh-6.8.2/conf/examples/aix.sap-ag.de    Wed Aug 25 16:00:06 1993
  737. --- conf/examples/aix.sap-ag.de    Thu Sep  2 10:56:44 1993
  738. ***************
  739. *** 15,18 ****
  740.   #
  741. ! options        TYPESIG=void SYS5 SYS5DIR SOCKETS
  742.   curses        -lcurses
  743.   sprintf        int
  744. --- 15,19 ----
  745.   #
  746. ! options        SYS5 SYS5DIR SOCKETS
  747.   curses        -lcurses
  748. + signal        void
  749.   sprintf        int
  750. *** ../mh-6.8.2/conf/examples/aix31.rpi.edu    Wed Aug 25 16:00:10 1993
  751. --- conf/examples/aix31.rpi.edu    Thu Sep  2 10:56:55 1993
  752. ***************
  753. *** 25,27 ****
  754.   options    RPOP SBACKUP='"\\043"' SOCKETS SYS5 SYS5DIR 
  755. ! options    TYPESIG='void' TZNAME VSPRINTF YP_LOOKUP
  756.   options    AIX AIX3_1 ISI WP NETWORK KPOP TRANSARC_KAS
  757. --- 25,27 ----
  758.   options    RPOP SBACKUP='"\\043"' SOCKETS SYS5 SYS5DIR 
  759. ! options    TZNAME VSPRINTF YP_LOOKUP
  760.   options    AIX AIX3_1 ISI WP NETWORK KPOP TRANSARC_KAS
  761. ***************
  762. *** 35,36 ****
  763. --- 35,37 ----
  764.   sprintf    int
  765. + signal    void
  766.   sharedlib    off
  767. *** ../mh-6.8.2/conf/examples/hpux.sap-ag.de    Wed Aug 25 16:00:07 1993
  768. --- conf/examples/hpux.sap-ag.de    Thu Sep  2 10:57:05 1993
  769. ***************
  770. *** 16,19 ****
  771.   ccoptions    +DA1.0 +DS1.0
  772. ! options        TYPESIG=void SYS5 NDIR SOCKETS _STRINGS
  773.   curses        -lcurses -ltermlib
  774.   sprintf        int
  775. --- 16,20 ----
  776.   ccoptions    +DA1.0 +DS1.0
  777. ! options        SYS5 NDIR SOCKETS _STRINGS
  778.   curses        -lcurses -ltermlib
  779. + signal        void
  780.   sprintf        int
  781. *** ../mh-6.8.2/conf/examples/sun4.0    Wed Aug 25 16:00:02 1993
  782. --- conf/examples/sun4.0    Thu Sep  2 10:57:29 1993
  783. ***************
  784. *** 10,12 ****
  785.   mts    sendmail/smtp
  786. ! options    BSD42 BSD43 SUN40 TYPESIG=void
  787.   options    DBMPWD
  788. --- 10,12 ----
  789.   mts    sendmail/smtp
  790. ! options    BSD42 BSD43 SUN40 
  791.   options    DBMPWD
  792. ***************
  793. *** 13,14 ****
  794. --- 13,15 ----
  795.   options BIND
  796. + signal    void
  797.   curses    -lcurses -ltermcap
  798. *** ../mh-6.8.2/conf/examples/sun4.1.1    Wed Aug 25 16:00:06 1993
  799. --- conf/examples/sun4.1.1    Thu Sep  2 10:57:37 1993
  800. ***************
  801. *** 11,13 ****
  802.   options    ATTVIBUG BIND BSD42 BSD43 DBMPWD
  803. ! options    LOCKF SUN40 SUN41 TYPESIG=void ZONEINFO
  804.   curses    -lcurses -ltermcap
  805. --- 11,14 ----
  806.   options    ATTVIBUG BIND BSD42 BSD43 DBMPWD
  807. ! options    LOCKF SUN40 SUN41 ZONEINFO
  808. ! signal    void
  809.   curses    -lcurses -ltermcap
  810. *** ../mh-6.8.2/conf/examples/sun411.rpi.edu    Wed Aug 25 16:00:01 1993
  811. --- conf/examples/sun411.rpi.edu    Thu Sep  2 10:57:47 1993
  812. ***************
  813. *** 24,26 ****
  814.   options    RPOP KPOP TRANSARC_KAS SBACKUP='"\\043"' 
  815. ! options    SUN40 SUN41 TYPESIG='void' TZNAME ZONEINFO 
  816.   options    ISI WP YP_LOOKUP
  817. --- 24,26 ----
  818.   options    RPOP KPOP TRANSARC_KAS SBACKUP='"\\043"' 
  819. ! options    SUN40 SUN41 TZNAME ZONEINFO 
  820.   options    ISI WP YP_LOOKUP
  821. ***************
  822. *** 33,34 ****
  823. --- 33,35 ----
  824.   sprintf    int
  825. + signal    void
  826.   ranlib    on
  827. *** ../mh-6.8.2/conf/examples/ultrix.sap-ag.de    Wed Aug 25 16:00:07 1993
  828. --- conf/examples/ultrix.sap-ag.de    Thu Sep  2 10:56:05 1993
  829. ***************
  830. *** 15,18 ****
  831.   #
  832. ! options        TYPESIG=void BSD42 BSD43
  833.   curses        -lcurses -ltermlib
  834.   #
  835. --- 15,19 ----
  836.   #
  837. ! options        BSD42 BSD43
  838.   curses        -lcurses -ltermlib
  839. + signal        void
  840.   #
  841. *** ../mh-6.8.2/conf/makefiles/MH-Makefile    Wed Aug 25 15:59:51 1993
  842. --- conf/makefiles/MH-Makefile    Fri Aug 27 15:15:52 1993
  843. ***************
  844. *** 4,6 ****
  845.   #    @(MHWARNING)
  846. ! # @(#)$Id: MH-Makefile,v 2.15 1992/12/03 16:23:40 jromine Exp $
  847.   ##############################################################################
  848. --- 4,6 ----
  849.   #    @(MHWARNING)
  850. ! # @(#)$Id: MH-Makefile,v 2.16 1993/08/27 22:15:49 jromine Exp $
  851.   ##############################################################################
  852. ***************
  853. *** 65,66 ****
  854. --- 65,67 ----
  855.   ETCDIR    =    $(DESTDIR)@(MHETCPATH)
  856. + MANDIR    =    $(DESTDIR)@(MHMANDIR)
  857.   SLIB    =    sbr
  858. ***************
  859. *** 74,80 ****
  860.   
  861. ! mkdirs:        $(BINDIR) $(ETCDIR)
  862.   
  863. ! $(BINDIR) $(ETCDIR):
  864. !         mkdir $@
  865. !         chmod 0755 $@
  866.   
  867. --- 75,80 ----
  868.   
  869. ! mkdirs:        $(BINDIR) $(ETCDIR) $(MANDIR)
  870.   
  871. ! $(BINDIR) $(ETCDIR) $(MANDIR):
  872. !         mkdir $@ && chmod 0755 $@
  873.   
  874. *** ../mh-6.8.2/conf/makefiles/doc    Wed Aug 25 15:59:54 1993
  875. --- conf/makefiles/doc    Fri Aug 27 15:16:03 1993
  876. ***************
  877. *** 4,6 ****
  878.   #    @(MHWARNING)
  879. ! # @(#)$Id: doc,v 2.25 1993/06/03 17:43:20 jromine Exp $
  880.   ##############################################################################
  881. --- 4,6 ----
  882.   #    @(MHWARNING)
  883. ! # @(#)$Id: doc,v 2.26 1993/08/27 22:15:57 jromine Exp $
  884.   ##############################################################################
  885. ***************
  886. *** 147,149 ****
  887.   
  888. ! inst-all:    @(MHMANGEN) inst-tmac $(inst-man1) $(inst-man5) $(inst-man8)
  889.   
  890. --- 147,150 ----
  891.   
  892. ! inst-all:    @(MHMANGEN) mkdirs inst-tmac \
  893. !             $(inst-man1) $(inst-man5) $(inst-man8)
  894.   
  895. ***************
  896. *** 175,176 ****
  897. --- 176,183 ----
  898.   ##############################################################################
  899. + mkdirs:        $(MANDIR)/$(DIR1) $(MANDIR)/$(DIR5) $(MANDIR)/$(DIR8)
  900. + $(MANDIR)/$(DIR1) $(MANDIR)/$(DIR5) $(MANDIR)/$(DIR8):
  901. +         -mkdir $@ && chmod 0755 $@
  902.   
  903. *** ../mh-6.8.2/conf/makefiles/zotnet/tws    Wed Aug 25 15:59:55 1993
  904. --- conf/makefiles/zotnet/tws    Sat Sep  4 12:32:39 1993
  905. ***************
  906. *** 4,6 ****
  907.   #    @(MHWARNING)
  908. ! # @(#)$Id: tws,v 1.16 1993/02/26 21:50:51 jromine Exp $
  909.   ##############################################################################
  910. --- 4,6 ----
  911.   #    @(MHWARNING)
  912. ! # @(#)$Id: tws,v 1.16 1993/02/26 21:50:51 jromine Exp jromine $
  913.   ##############################################################################
  914. ***************
  915. *** 73,76 ****
  916.           $(LEX) dtimep.lex | sed -f lexedit.sed > dtimep.c
  917. !         len=`wc -l dtimep.c | awk ' { print $$1 } '`; \
  918. !             if [ $$len -eq 1 ]; then cp dtimep.c-lexed dtimep.c; fi
  919.   
  920. --- 73,80 ----
  921.           $(LEX) dtimep.lex | sed -f lexedit.sed > dtimep.c
  922. !         -@len=`wc -l dtimep.c | awk ' { print $$1 } '`; \
  923. !         if [ $$len -gt 10 ]; \
  924. !         then exit 0; \
  925. !         else echo "lex failed: using pre-lexed dtimep.c"; \
  926. !             cp dtimep.c-lexed dtimep.c; \
  927. !         fi
  928.   
  929. *** ../mh-6.8.2/conf/mh-gen.8    Wed Aug 25 15:59:46 1993
  930. --- conf/mh-gen.8    Tue Nov 30 16:44:29 1993
  931. ***************
  932. *** 1,2 ****
  933. ! .\" @(#)$Id: mh-gen.8,v 2.112 1993/08/25 18:07:10 jromine Exp $
  934.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  935. --- 1,2 ----
  936. ! .\" @(#)$Id: mh-gen.8,v 2.115 1993/12/01 00:44:23 jromine Exp $
  937.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  938. ***************
  939. *** 3,5 ****
  940.   .if n .na
  941. ! .TH MH-GEN 8 MH.6.8.2 [mh.6]
  942.   .SH NAME
  943. --- 3,5 ----
  944.   .if n .na
  945. ! .TH MH-GEN 8 MH.6.8.3 [mh.6]
  946.   .SH NAME
  947. ***************
  948. *** 1161,1164 ****
  949.   to change your MH configuration.  If so, cd back to the \fBconf/\fP
  950. ! directory, re-edit the file \fBMH\fP, and re-run
  951. ! \fImhconfig\fP.
  952.   .PP
  953. --- 1161,1164 ----
  954.   to change your MH configuration.  If so, cd back to the \fBconf/\fP
  955. ! directory, re-edit the files \fBMH\fP
  956. ! and \fBconf/config/mtstailor\fR, and re-run \fImhconfig\fP.
  957.   .PP
  958. ***************
  959. *** 1343,1347 ****
  960.   .SH INSTALLATION
  961. ! If the directories you chose for the user\-programs and
  962. ! support\-programs
  963. ! (\*(lqbin\*(rq and \*(lqetc\*(rq in the \fBconf/MH\fR file)
  964.   don't exist,
  965. --- 1343,1348 ----
  966.   .SH INSTALLATION
  967. ! If the directories you chose for the user\-programs,
  968. ! support\-programs and manuals
  969. ! (\*(lqbin\*(rq, \*(lqetc\*(rq, \*(lqpopdir\*(rq, \*(lqslibdir\*(rq,
  970. ! and \*(lqmandir\*(rq in the \fBconf/MH\fR file)
  971.   don't exist,
  972. *** ../mh-6.8.2/conf/mhconfig.c    Wed Aug 25 15:59:45 1993
  973. --- conf/mhconfig.c    Tue Nov 30 14:01:08 1993
  974. ***************
  975. *** 1,7 ****
  976.   /* mhconfig.c - configure MH */
  977.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  978.   #ifndef    lint
  979. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.70 1993/08/25 18:07:10 jromine Exp $";
  980.   #endif    /* lint */
  981.   
  982.   #include <ctype.h>
  983. --- 1,7 ----
  984.   /* mhconfig.c - configure MH */
  985.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  986.   #ifndef    lint
  987. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.71 1993/11/30 22:01:04 jromine Exp $";
  988.   #endif    /* lint */
  989.   
  990.   #include <ctype.h>
  991. ***************
  992. *** 29,35 ****
  993.   #define    MAKE        "../%s/Makefile"
  994.   
  995.   #define    WARNING    "This file is automatically generated.  Do not edit!"
  996. ! #define    MHRELEASE    "6.8.2"        /* for version: "Maj.min.pat" */
  997.   #define    MHCENTERFOOT    "MH.6.8"    /* for nroff page footers */
  998.   #define    MHLEFTFOOT    "[mh.6]"    /* [mh.6]    MH.6.6   page# */
  999.   #define    MHSLIBVER    "3.2"        /* SunOS4 shared library version */
  1000. --- 29,35 ----
  1001.   #define    MAKE        "../%s/Makefile"
  1002.   
  1003.   #define    WARNING    "This file is automatically generated.  Do not edit!"
  1004. ! #define    MHRELEASE    "6.8.3"        /* for version: "Maj.min.pat" */
  1005.   #define    MHCENTERFOOT    "MH.6.8"    /* for nroff page footers */
  1006.   #define    MHLEFTFOOT    "[mh.6]"    /* [mh.6]    MH.6.6   page# */
  1007.   #define    MHSLIBVER    "3.2"        /* SunOS4 shared library version */
  1008. *** ../mh-6.8.2/miscellany/multi-media/READ-ME    Wed Aug 25 15:59:09 1993
  1009. --- miscellany/multi-media/READ-ME    Wed Sep  1 19:07:33 1993
  1010. ***************
  1011. *** 2,4 ****
  1012.   
  1013. ! [ READ-ME - Wed Oct 21 15:35:57 1992 - multi-media MH for MH 6.7 - /mtr ]
  1014.   
  1015. --- 2,4 ----
  1016.   
  1017. ! [ READ-ME - Wed Sep  1 19:07:25 1993 - multi-media MH - /mtr ]
  1018.   
  1019. ***************
  1020. *** 257,268 ****
  1021.        can fiddle with the volume controls whenever you like.
  1022. -                     video
  1023. -      If you are running the X window system, you can use the mpeg_play
  1024. -      program to display a video/mpeg content.
  1025. -     host    toe.cs.berkeley.edu
  1026. -     dir    pub/multimedia/mpeg/
  1027. -     file    mpeg-2.0.tar.Z
  1028. -     mode    binary
  1029. --- 257 ----
  1030. *** /dev/null    Tue Nov 30 18:53:36 1993
  1031. --- miscellany/multi-media/misc/READ-ME    Tue Nov 30 19:33:07 1993
  1032. ***************
  1033. *** 0 ****
  1034. --- 1,15 ----
  1035. + [ READ-ME - Wed Sep  1 19:08:21 1993 - miscellaneous stuff - /mtr ]
  1036. + mimeless
  1037. +   
  1038. +      This invokes less in a more interesting way to display text/plain
  1039. +      contents.  In your .mhn_profile, add the line
  1040. +   
  1041. +       mhn-show-text/plain: mimeless "%d" text/%s '%F'
  1042. +   
  1043. + rt2raw.c
  1044. +      This is a relly dumb richtext interpeter.  The compilation and
  1045. +      installation instructions are in miscellany/multi-media/READ-ME.
  1046. *** /dev/null    Tue Nov 30 18:53:36 1993
  1047. --- miscellany/multi-media/misc/mimeless    Thu Sep  2 21:31:21 1993
  1048. ***************
  1049. *** 0 ****
  1050. --- 1,19 ----
  1051. + #!/bin/sh
  1052. + : mhn-show-text/plain: mimeless "%d" text/%s '%F'
  1053. + if [ $# != 3 ]; then
  1054. +   echo "usage: $0 message-1 message-2 file-name" 1>&2
  1055. +   exit 1
  1056. + fi
  1057. + if [ ! -r $3 ]; then
  1058. +   echo "File does not exist." 1>&2
  1059. +   exit 1
  1060. + fi
  1061. + msg1=`echo $1 | sed -e 's/\%/\\\%/g' -e 's/\?/\\\?/g' -e 's/:/\\:/g' \
  1062. +         -e 's/\./\\\./g' -e 's/\"/\\\"/g'`
  1063. + msg2=`echo $2 | sed -e 's/\%/\\\%/g' -e 's/\?/\\\?/g' -e 's/:/\\:/g' \
  1064. +         -e 's/\./\\\./g' -e 's/\"/\\\"/g'`
  1065. + exec less -P"\"${msg1}\" ${msg2} ?pB%pB\%.%t" $3
  1066. *** ../mh-6.8.2/miscellany/multi-media/profiles/mhn_defaults    Wed Aug 25 15:59:11 1993
  1067. --- miscellany/multi-media/profiles/mhn_defaults    Tue Sep  7 21:05:07 1993
  1068. ***************
  1069. *** 5,7 ****
  1070.   mhn-show-application/x-ivs: %pivs_replay -o '%F'
  1071. ! mhn-show-audio/basic: %p/usr/demo/SOUND/raw2audio 2>/dev/null | play
  1072.   mhn-show-audio/x-next: %p/usr/openwin/bin/adpcm_dec | /usr/demo/SOUND/play
  1073. --- 5,7 ----
  1074.   mhn-show-application/x-ivs: %pivs_replay -o '%F'
  1075. ! mhn-show-audio/basic: %p/usr/demo/SOUND/raw2audio 2>/dev/null | /usr/demo/SOUND/play
  1076.   mhn-show-audio/x-next: %p/usr/openwin/bin/adpcm_dec | /usr/demo/SOUND/play
  1077. *** ../mh-6.8.2/miscellany/multi-media/profiles/mtr.mh_profile    Wed Aug 25 15:59:11 1993
  1078. --- miscellany/multi-media/profiles/mtr.mh_profile    Tue Sep  7 21:05:02 1993
  1079. ***************
  1080. *** 54,56 ****
  1081.   automhnproc:    mhn
  1082. ! mhnproc:    mhn
  1083.   mcomp:        -editor rapid -form comp.mhn
  1084. --- 54,56 ----
  1085.   automhnproc:    mhn
  1086. ! mhnproc:    xmhn
  1087.   mcomp:        -editor rapid -form comp.mhn
  1088. *** ../mh-6.8.2/miscellany/multi-media/profiles/mtr.mhn_profile.openwindows    Wed Aug 25 15:59:11 1993
  1089. --- miscellany/multi-media/profiles/mtr.mhn_profile.openwindows    Tue Sep  7 21:06:06 1993
  1090. ***************
  1091. *** 1,2 ****
  1092. ! mhn-show-application/PostScript: gs -q -dSAFER -- %F
  1093. ! mhn-store-message/rfc822: %m%P.msg
  1094. --- 1,4 ----
  1095. ! mhn-show-application/PostScript: gs -q -dSAFER -- '%F'
  1096. ! mhn-show-multipart/enabled-mail: %pem_play -generic %F
  1097. ! mhn-show-application/safe-tcl: %pst_play %a '%F'
  1098. ! mhn-show-text/plain: mimeless "%d" text/%s '%F'
  1099. *** ../mh-6.8.2/mts/sendmail/smail.c    Wed Aug 25 15:58:24 1993
  1100. --- mts/sendmail/smail.c    Tue Nov 30 19:50:36 1993
  1101. ***************
  1102. *** 1,6 ****
  1103.   /* smail.c - MH interface to SendMail/SMTP */
  1104.   #ifndef    lint
  1105. ! static char ident[] = "@(#)$Id: smail.c,v 1.25 1993/08/25 17:17:29 jromine Exp $";
  1106.   #endif
  1107.   
  1108.   /* LINTLIBRARY */
  1109. --- 1,6 ----
  1110.   /* smail.c - MH interface to SendMail/SMTP */
  1111.   #ifndef    lint
  1112. ! static char ident[] = "@(#)$Id: smail.c,v 1.27 1993/12/01 03:50:31 jromine Exp $";
  1113.   #endif
  1114.   
  1115.   /* LINTLIBRARY */
  1116. ***************
  1117. *** 113,119 ****
  1118.   static int    sm_werror(), smhear(), sm_rrecord(), sm_rerror();
  1119.   
  1120.   #ifdef    MPOP
  1121. ! extern    int    errno
  1122.   #ifndef    BSD44
  1123.   extern    int    sys_nerr;
  1124.   extern    char   *sys_errlist[];
  1125. --- 113,119 ----
  1126.   static int    sm_werror(), smhear(), sm_rrecord(), sm_rerror();
  1127.   
  1128.   #ifdef    MPOP
  1129. ! extern    int    errno;
  1130.   #ifndef    BSD44
  1131.   extern    int    sys_nerr;
  1132.   extern    char   *sys_errlist[];
  1133. ***************
  1134. *** 162,167 ****
  1135. --- 162,169 ----
  1136.       if (sm_rfp != NULL && sm_wfp != NULL)
  1137.       return RP_OK;
  1138.   
  1139. +     if (client == NULL || *client == '\0')
  1140. +     client = clientname;
  1141.   #ifdef ZMAILER
  1142.       if (client == NULL || *client == '\0')
  1143.       client = "localhost";
  1144. ***************
  1145. *** 302,307 ****
  1146. --- 304,311 ----
  1147.       if (sm_rfp != NULL && sm_wfp != NULL)
  1148.       goto send_options;
  1149.   
  1150. +     if (client == NULL || *client == '\0')
  1151. +     client = clientname;
  1152.   #ifdef ZMAILER
  1153.       if (client == NULL || *client == '\0')
  1154.       client = "localhost";
  1155. *** ../mh-6.8.2/papers/changes/mh-changes.ms    Wed Aug 25 15:58:23 1993
  1156. --- papers/changes/mh-changes.ms    Tue Nov 30 15:57:38 1993
  1157. ***************
  1158. *** 1,2 ****
  1159. ! .\" @(#)$Id: mh-changes.ms,v 1.27 1993/08/25 18:11:13 jromine Exp $
  1160.   .\" Standard -ms macros
  1161. --- 1,2 ----
  1162. ! .\" @(#)$Id: mh-changes.ms,v 1.28 1993/11/30 23:57:26 jromine Exp $
  1163.   .\" Standard -ms macros
  1164. ***************
  1165. *** 6,8 ****
  1166.   .\" remember to update date in text below
  1167. ! .DA "August 25, 1993"
  1168.   .if n \{\
  1169. --- 6,8 ----
  1170.   .\" remember to update date in text below
  1171. ! .DA "December 1, 1993"
  1172.   .if n \{\
  1173. ***************
  1174. *** 99,103 ****
  1175.   .KE
  1176. ! .ds LH Changes for MH 6.8.2
  1177.   .bp
  1178.   .SH
  1179.   CHANGES FOR MH 6.8.2
  1180. --- 99,143 ----
  1181.   .KE
  1182. ! .ds LH Changes for MH 6.8.3
  1183.   .bp
  1184. + .SH 
  1185. + CHANGES FOR MH 6.8.3
  1186. + .LP
  1187. + The MH 6.8.3 maintenance release contains few user-visible
  1188. + changes.  Most of the changes are internal to the
  1189. + multi-media display program \fImhn\fP to support
  1190. + RFC 1521 (the new MIME standard).
  1191. + This is the current version of MH as of December 1, 1993.
  1192. + .SH 
  1193. + Runtime Tailoring
  1194. + .LP
  1195. + When posting mail using the SMTP,
  1196. + \fIpost\fP does not normally send the \fBHELO\fP command.  
  1197. + This is because \fISendMail\fP would fail
  1198. + if the host name given in the \fBHELO\fP command was the local host.
  1199. + Later versions
  1200. + of \fISendMail\fP will now complain if you omit the \fBHELO\fP
  1201. + command.
  1202. + .PP
  1203. + If you specify a hostname with the \fBclientname:\fP option
  1204. + in the \fImtstailor\fP file,
  1205. + \fIpost\fP will give the \fBHELO\fP command with that name,
  1206. + otherwise no \fBHELO\fP command is given.
  1207. + See \fImh-tailor\fP\|(5) for more details.
  1208.   .SH
  1209. + User Interface Programs
  1210. + .IP folder \w'msgchk'u+2n
  1211. + The \fIfolder\fP command now has `\-create' and `\-nocreate'
  1212. + options.  See \fIfolder\fP\|(1) for details.
  1213. + .IP inc
  1214. + A bug where `\-host' would not override the \fBpophost\fP
  1215. + as set in the \fImtstailor\fP file has been fixed.
  1216. + This bug was also fixed in \fImsgchk\fP.
  1217. + .IP mhn
  1218. + The \fImhn\fP command has several changes:
  1219. + updates for conformance with RFC 1521,
  1220. + addition of two caches: public and private,
  1221. + addition of two caching policies: one for reading and one for writing,
  1222. + support for storing multipart entities, and
  1223. + a few bug fixes.  See \fImhn\fP\|(1) for complete details.
  1224. + .SH
  1225.   CHANGES FOR MH 6.8.2
  1226. ***************
  1227. *** 110,113 ****
  1228.   .NL
  1229. ! This is the current released version of \fIMH\fP
  1230. ! as of August 25, 1993.
  1231.   .SH
  1232. --- 150,153 ----
  1233.   .NL
  1234. ! This version of \fIMH\fP 
  1235. ! was released August 25, 1993, but was not widely distributed.
  1236.   .SH
  1237. *** ../mh-6.8.2/sbr/m_getdefs.c    Wed Aug 25 15:57:29 1993
  1238. --- sbr/m_getdefs.c    Fri Sep  3 10:39:02 1993
  1239. ***************
  1240. *** 1,6 ****
  1241.   /* m_getdefs.c - read the user's MH environment */
  1242.   #ifndef    lint
  1243. ! static char ident[] = "@(#)$Id: m_getdefs.c,v 1.7 1993/08/25 17:20:41 jromine Exp $";
  1244.   #endif    /* lint */
  1245.   
  1246.   #include "../h/mh.h"
  1247. --- 1,6 ----
  1248.   /* m_getdefs.c - read the user's MH environment */
  1249.   #ifndef    lint
  1250. ! static char ident[] = "@(#)$Id: m_getdefs.c,v 1.8 1993/09/03 17:38:51 jromine Exp $";
  1251.   #endif    /* lint */
  1252.   
  1253.   #include "../h/mh.h"
  1254. ***************
  1255. *** 24,31 ****
  1256.   #define    FOpen(f,m,e,c)    fopen (f, m)
  1257.   #define    FClose(f)    fclose (f)
  1258.   #else    /* OVERHEAD */
  1259. ! FILE   *FOpen ();
  1260. ! int    FClose ();
  1261.   
  1262.   off_t    lseek ();
  1263.   #endif    /* OVERHEAD */
  1264. --- 24,31 ----
  1265.   #define    FOpen(f,m,e,c)    fopen (f, m)
  1266.   #define    FClose(f)    fclose (f)
  1267.   #else    /* OVERHEAD */
  1268. ! static FILE    *FOpen ();
  1269. ! static int    FClose ();
  1270.   
  1271.   off_t    lseek ();
  1272.   #endif    /* OVERHEAD */
  1273. *** ../mh-6.8.2/support/general/viamail.sh    Wed Aug 25 15:57:05 1993
  1274. --- support/general/viamail.sh    Tue Oct 26 09:05:36 1993
  1275. ***************
  1276. *** 1,3 ****
  1277.   : run this script through /bin/sh
  1278. ! : '@(#)$Id: viamail.sh,v 1.4 1993/08/20 15:49:19 jromine Exp $'
  1279.   
  1280. --- 1,3 ----
  1281.   : run this script through /bin/sh
  1282. ! : '@(#)$Id: viamail.sh,v 1.5 1993/10/26 16:05:23 jromine Exp $'
  1283.   
  1284. ***************
  1285. *** 30,32 ****
  1286.       mhn -viamail "$mailpath" -viasubj "$subject" \
  1287. !     -viaparm "type=tar; x-conversions=x-compress" \
  1288.       -viacmnt "extract with uncompress | tar xvpf -" \
  1289. --- 30,32 ----
  1290.       mhn -viamail "$mailpath" -viasubj "$subject" \
  1291. !     -viaparm "type=tar; x-conversions=compress" \
  1292.       -viacmnt "extract with uncompress | tar xvpf -" \
  1293. *** ../mh-6.8.2/uip/ali.c    Wed Aug 25 15:56:29 1993
  1294. --- uip/ali.c    Wed Sep  1 17:05:24 1993
  1295. ***************
  1296. *** 1,6 ****
  1297.   /* ali.c - the new ali */
  1298.   #ifndef    lint
  1299. ! static char ident[] = "@(#)$Id: ali.c,v 1.8 1992/12/15 00:20:22 jromine Exp $";
  1300.   #endif    /* lint */
  1301.   
  1302.   #include "../h/mh.h"
  1303. --- 1,6 ----
  1304.   /* ali.c - the new ali */
  1305.   #ifndef    lint
  1306. ! static char ident[] = "@(#)$Id: ali.c,v 1.9 1993/09/02 00:05:15 jromine Exp $";
  1307.   #endif    /* lint */
  1308.   
  1309.   #include "../h/mh.h"
  1310. ***************
  1311. *** 137,143 ****
  1312.       }
  1313.   
  1314.       if (!noalias) {
  1315. -     (void) alias (AliasFile);
  1316.       if (cp = m_find ("Aliasfile")) { /* allow Aliasfile: profile entry */
  1317.           char *dp = NULL;
  1318.   
  1319. --- 137,142 ----
  1320. ***************
  1321. *** 148,153 ****
  1322. --- 147,153 ----
  1323.           if (dp)
  1324.           free(dp);
  1325.       }
  1326. +     (void) alias (AliasFile);
  1327.       }
  1328.       
  1329.   
  1330. *** ../mh-6.8.2/uip/dropsbr.c    Wed Aug 25 15:56:28 1993
  1331. --- uip/dropsbr.c    Fri Aug 27 16:00:11 1993
  1332. ***************
  1333. *** 1,6 ****
  1334.   /* dropsbr.c - write to a mailbox */
  1335.   #ifndef    lint
  1336. ! static char ident[] = "@(#)$Id: dropsbr.c,v 1.16 1993/08/25 17:25:08 jromine Exp $";
  1337.   #endif    /* lint */
  1338.   
  1339.   #include <stdio.h>
  1340. --- 1,6 ----
  1341.   /* dropsbr.c - write to a mailbox */
  1342.   #ifndef    lint
  1343. ! static char ident[] = "@(#)$Id: dropsbr.c,v 1.17 1993/08/27 23:00:00 jromine Exp $";
  1344.   #endif    /* lint */
  1345.   
  1346.   #include <stdio.h>
  1347. ***************
  1348. *** 534,540 ****
  1349.           tdp->d_size = ntohl(tdp->d_size);
  1350.           tdp->d_start = ntohl(tdp->d_start);
  1351.           tdp->d_stop = ntohl(tdp->d_stop);
  1352. -         tdp++;
  1353.       }
  1354.   #endif
  1355.       *drops = dp;
  1356. --- 534,539 ----
  1357. *** ../mh-6.8.2/uip/folder.c    Wed Aug 25 15:56:47 1993
  1358. --- uip/folder.c    Fri Aug 27 16:23:16 1993
  1359. ***************
  1360. *** 1,6 ****
  1361.   /* folder(s).c - report on folders */
  1362.   #ifndef    lint
  1363. ! static char ident[] = "@(#)$Id: folder.c,v 2.9 1992/12/15 00:20:22 jromine Exp $";
  1364.   #endif    /* lint */
  1365.   
  1366.   #include "../h/mh.h"
  1367. --- 1,6 ----
  1368.   /* folder(s).c - report on folders */
  1369.   #ifndef    lint
  1370. ! static char ident[] = "@(#)$Id: folder.c,v 2.11 1993/08/27 23:23:06 jromine Exp $";
  1371.   #endif    /* lint */
  1372.   
  1373.   #include "../h/mh.h"
  1374. ***************
  1375. *** 19,67 ****
  1376.   #define    ALLSW    0
  1377.       "all", 0,
  1378.   
  1379. ! #define    FASTSW    1
  1380.       "fast", 0,
  1381. ! #define    NFASTSW    2
  1382.       "nofast", 0,
  1383.   
  1384. ! #define    HDRSW    3
  1385.       "header", 0,
  1386. ! #define    NHDRSW    4
  1387.       "noheader", 0,
  1388.   
  1389. ! #define    PACKSW    5
  1390.       "pack", 0,
  1391. ! #define    NPACKSW    6
  1392.       "nopack", 0,
  1393. ! #define    VERBSW    7
  1394.       "verbose", 0,
  1395. ! #define    NVERBSW    8
  1396.       "noverbose", 0,
  1397.   
  1398. ! #define    RECURSW    9
  1399.       "recurse", 0,
  1400. ! #define    NRECRSW    10
  1401.       "norecurse", 0,
  1402.   
  1403. ! #define    TOTALSW    11
  1404.       "total", 0,
  1405. ! #define    NTOTLSW    12
  1406.       "nototal", 0,
  1407.   
  1408. ! #define    PRNTSW    13
  1409.       "print", 0,
  1410. ! #define    NPRNTSW    14
  1411.       "noprint", -4,
  1412. ! #define    LISTSW    15
  1413.       "list", 0,
  1414. ! #define    NLISTSW    16
  1415.       "nolist", 0,
  1416. ! #define    PUSHSW    17
  1417.       "push", 0,
  1418. ! #define    POPSW    18
  1419.       "pop", 0,
  1420.   
  1421. ! #define    HELPSW    19
  1422.       "help", 4,
  1423.   
  1424.       NULL, 0
  1425. --- 19,72 ----
  1426.   #define    ALLSW    0
  1427.       "all", 0,
  1428.   
  1429. ! #define    CREATSW    1
  1430. !     "create", 0,
  1431. ! #define    NCREATSW 2
  1432. !     "nocreate", 0,
  1433. ! #define    FASTSW    3
  1434.       "fast", 0,
  1435. ! #define    NFASTSW    4
  1436.       "nofast", 0,
  1437.   
  1438. ! #define    HDRSW    5
  1439.       "header", 0,
  1440. ! #define    NHDRSW    6
  1441.       "noheader", 0,
  1442.   
  1443. ! #define    PACKSW    7
  1444.       "pack", 0,
  1445. ! #define    NPACKSW    8
  1446.       "nopack", 0,
  1447. ! #define    VERBSW    9
  1448.       "verbose", 0,
  1449. ! #define    NVERBSW    10
  1450.       "noverbose", 0,
  1451.   
  1452. ! #define    RECURSW    11
  1453.       "recurse", 0,
  1454. ! #define    NRECRSW    12
  1455.       "norecurse", 0,
  1456.   
  1457. ! #define    TOTALSW    13
  1458.       "total", 0,
  1459. ! #define    NTOTLSW    14
  1460.       "nototal", 0,
  1461.   
  1462. ! #define    PRNTSW    15
  1463.       "print", 0,
  1464. ! #define    NPRNTSW    16
  1465.       "noprint", -4,
  1466. ! #define    LISTSW    17
  1467.       "list", 0,
  1468. ! #define    NLISTSW    18
  1469.       "nolist", 0,
  1470. ! #define    PUSHSW    19
  1471.       "push", 0,
  1472. ! #define    POPSW    20
  1473.       "pop", 0,
  1474.   
  1475. ! #define    HELPSW    21
  1476.       "help", 4,
  1477.   
  1478.       NULL, 0
  1479. ***************
  1480. *** 72,77 ****
  1481. --- 77,83 ----
  1482.   extern int errno;
  1483.   
  1484.   static int  fshort = 0;
  1485. + static int  fcreat = 0;
  1486.   static int  fpack = 0;
  1487.   static int  fverb = 0;
  1488.   static int  fheader = 0;
  1489. ***************
  1490. *** 146,151 ****
  1491. --- 152,164 ----
  1492.               all++;
  1493.               continue;
  1494.   
  1495. +         case CREATSW: 
  1496. +             fcreat = 1;
  1497. +             continue;
  1498. +         case NCREATSW: 
  1499. +             fcreat = -1;
  1500. +             continue;
  1501.           case FASTSW: 
  1502.               fshort++;
  1503.               continue;
  1504. ***************
  1505. *** 325,334 ****
  1506.       if (stat (strcpy (buf, m_maildir (folder)), &st) == NOTOK) {
  1507.           if (errno != ENOENT)
  1508.           adios (buf, "error on folder");
  1509. !         cp = concat ("Create folder \"", buf, "\"? ", NULLCP);
  1510. !         if (!getanswer (cp))
  1511. !         done (1);
  1512. !         free (cp);
  1513.           if (!makedir (buf))
  1514.           adios (NULLCP, "unable to create folder %s", buf);
  1515.       }
  1516. --- 338,354 ----
  1517.       if (stat (strcpy (buf, m_maildir (folder)), &st) == NOTOK) {
  1518.           if (errno != ENOENT)
  1519.           adios (buf, "error on folder");
  1520. !         switch (fcreat) {
  1521. !         case 0:            /* ask before create */
  1522. !             cp = concat ("Create folder \"", buf, "\"? ", NULLCP);
  1523. !             if (!getanswer (cp))
  1524. !             done (1);
  1525. !             free (cp);
  1526. !             break;
  1527. !         case -1:        /* do not create */
  1528. !             done (1);
  1529. !             break;
  1530. !         }
  1531.           if (!makedir (buf))
  1532.           adios (NULLCP, "unable to create folder %s", buf);
  1533.       }
  1534. *** ../mh-6.8.2/uip/inc.c    Wed Aug 25 15:56:29 1993
  1535. --- uip/inc.c    Wed Sep  1 14:43:18 1993
  1536. ***************
  1537. *** 1,6 ****
  1538.   /* inc.c - incorporate messages from a maildrop into a folder */
  1539.   #ifndef    lint
  1540. ! static char ident[] = "@(#)$Id: inc.c,v 1.21 1993/08/20 15:50:13 jromine Exp $";
  1541.   #endif    /* lint */
  1542.   
  1543.   #ifdef    MAILGROUP
  1544. --- 1,6 ----
  1545.   /* inc.c - incorporate messages from a maildrop into a folder */
  1546.   #ifndef    lint
  1547. ! static char ident[] = "@(#)$Id: inc.c,v 1.22 1993/09/01 21:41:48 jromine Exp $";
  1548.   #endif    /* lint */
  1549.   
  1550.   #ifdef    MAILGROUP
  1551. ***************
  1552. *** 225,230 ****
  1553. --- 225,247 ----
  1554.       mts_init (invo_name);
  1555.   
  1556.   #ifdef    POP
  1557. + #ifdef HESIOD
  1558. +     /*
  1559. +      * Scheme is:
  1560. +      *        use MAILHOST environment variable if present,
  1561. +      *  else try Hesiod.
  1562. +      *  If that fails, use the default (if any)
  1563. +      *  provided by mtstailor in mts_init()
  1564. +      */
  1565. +     if ((tmphost = getenv("MAILHOST")) != NULL)
  1566. +     pophost = tmphost;
  1567. +     else if ((po = hes_getmailhost(getusr())) != NULL &&
  1568. +         strcmp(po->po_type, "POP") == 0)
  1569. +     pophost = po->po_host;
  1570. + #endif /* HESIOD */
  1571. +     if (pophost && *pophost)
  1572. +     host = pophost;
  1573.       if ((cp = getenv ("MHPOPDEBUG")) && *cp)
  1574.       snoop++;
  1575.   #endif
  1576. ***************
  1577. *** 373,398 ****
  1578.   #endif    /* MAILGROUP */
  1579.   
  1580.   #ifdef    POP
  1581. - #ifdef HESIOD
  1582. -     /*
  1583. -      * Scheme is:
  1584. -      *        use MAILHOST environment variable if present,
  1585. -      *  else try Hesiod.
  1586. -      *  If that fails, use the default (if any)
  1587. -      *  provided by mtstailor in mts_init()
  1588. -      */
  1589. -     if (pophost == NULL || pophost[0] == '\0')
  1590. -       {
  1591. -     if ((tmphost = getenv("MAILHOST")) != NULL)
  1592. -       pophost = tmphost;
  1593. -     else if ((po = hes_getmailhost(getusr())) != NULL &&
  1594. -          strcmp(po->po_type, "POP") == 0)
  1595. -       pophost = po->po_host;
  1596. -       }
  1597. - #endif /* HESIOD */
  1598. -     if (pophost && *pophost)
  1599. -     host = pophost;
  1600.       if (host && !*host)
  1601.       host = NULL;
  1602.       if (from || !host || rpop <= 0)
  1603. --- 390,395 ----
  1604. *** ../mh-6.8.2/uip/mhn.c    Wed Aug 25 15:56:33 1993
  1605. --- uip/mhn.c    Tue Oct 26 15:18:06 1993
  1606. ***************
  1607. *** 1,6 ****
  1608.   /* mhn.c - multi-media MH */
  1609.   #ifndef    lint
  1610. ! static char ident[] = "@(#)$Id: mhn.c,v 2.23 1993/08/25 17:26:22 jromine Exp $";
  1611.   #endif    /* lint */
  1612.   
  1613.   #include "../h/mh.h"
  1614. --- 1,6 ----
  1615.   /* mhn.c - multi-media MH */
  1616.   #ifndef    lint
  1617. ! static char ident[] = "@(#)$Id: mhn.c,v 2.35 1993/10/26 22:17:44 jromine Exp $";
  1618.   #endif    /* lint */
  1619.   
  1620.   #include "../h/mh.h"
  1621. ***************
  1622. *** 9,14 ****
  1623. --- 9,15 ----
  1624.   #include <setjmp.h>
  1625.   #include <signal.h>
  1626.   #include <stdio.h>
  1627. + #include "../zotnet/mts.h"
  1628.   #include <sys/types.h>
  1629.   #include <sys/stat.h>
  1630.   #ifdef    BSD42
  1631. ***************
  1632. *** 27,130 ****
  1633.       "noauto", 0,
  1634.   
  1635.   #define    CACHESW       2
  1636. !     "cache policy", 0,
  1637.   
  1638. ! #define    CHECKSW    3
  1639.       "check", 0,
  1640. ! #define    NCHECKSW   4
  1641.       "nocheck", 0,
  1642.   
  1643. ! #define    DEBUGSW       5
  1644.       "debug", -5,
  1645.       
  1646. ! #define    EBCDICSW   6
  1647.       "ebcdicsafe", 0,
  1648. ! #define    NEBCDICSW  7
  1649.       "noebcdicsafe", 0,
  1650.   
  1651. ! #define    FORMSW       8
  1652.       "form formfile", 4,
  1653.   
  1654. ! #define    HEADSW       9
  1655.       "headers", 0,
  1656. ! #define    NHEADSW      10
  1657.       "noheaders", 0,
  1658.   
  1659. ! #define    LISTSW      11
  1660.       "list", 0,
  1661. ! #define    NLISTSW      12
  1662.       "nolist", 0,
  1663.   
  1664. ! #define    PARTSW      13
  1665.       "part number", 0,
  1666.   
  1667. ! #define    PAUSESW      14
  1668.       "pause", 0,
  1669. ! #define    NPAUSESW  15
  1670.       "nopause", 0,
  1671.   
  1672. ! #define    SIZESW      16
  1673.       "realsize", 0,
  1674. ! #define    NSIZESW      17
  1675.       "norealsize", 0,
  1676.   
  1677. ! #define    RFC934SW  18
  1678.       "rfc934mode", 0,
  1679. ! #define    NRFC934SW 19
  1680.       "norfc934mode", 0,
  1681.   
  1682. ! #define    SERIALSW  20
  1683.       "serialonly", 0,
  1684. ! #define    NSERIALSW 21
  1685.       "noserialonly", 0,
  1686.   
  1687. ! #define    SHOWSW      22
  1688.       "show", 0,
  1689. ! #define    NSHOWSW      23
  1690.       "noshow", 0,
  1691.   
  1692. ! #define    STORESW      24
  1693.       "store", 0,
  1694. ! #define    NSTORESW  25
  1695.       "nostore", 0,
  1696.   
  1697. ! #define    TYPESW      26
  1698.       "type content", 0,
  1699.   
  1700. ! #define    VERBSW      27
  1701.       "verbose", 0,
  1702. ! #define    NVERBSW      28
  1703.       "noverbose", 0,
  1704.       
  1705. ! #define    HELPSW     29
  1706.       "help", 4,
  1707.   
  1708. ! #define    PROGSW   30
  1709.       "moreproc program", -4,
  1710. ! #define    NPROGSW     31
  1711.       "nomoreproc", -3,
  1712.   
  1713. ! #define    LENSW     32
  1714.       "length lines", -4,
  1715. ! #define    WIDSW     33
  1716.       "width columns", -4,
  1717.   
  1718. ! #define    FILESW     34        /* interface from show */
  1719. !     "file file", -4,
  1720. ! #define    VIAMSW     35
  1721.       "viamail mailpath", -7,
  1722. ! #define    VIASSW     36
  1723.       "viasubj subject", -7,
  1724. ! #define    VIAPSW     37
  1725.       "viaparm arguments", -7,
  1726. ! #define    VIADSW     38
  1727.       "viadesc text", -7,
  1728. ! #define    VIACSW     39
  1729.       "viacmnt text", -7,
  1730. ! #define    VIAZSW     40
  1731.       "viadelay seconds", -8,
  1732. ! #define    VIAFSW     41
  1733.       "viafrom mailpath", -7,
  1734.   
  1735.       NULL, 0
  1736. --- 28,139 ----
  1737.       "noauto", 0,
  1738.   
  1739.   #define    CACHESW       2
  1740. !     "cache", 0,
  1741. ! #define    NCACHESW   3
  1742. !     "nocache", 0,
  1743.   
  1744. ! #define    CHECKSW    4
  1745.       "check", 0,
  1746. ! #define    NCHECKSW   5
  1747.       "nocheck", 0,
  1748.   
  1749. ! #define    DEBUGSW       6
  1750.       "debug", -5,
  1751.       
  1752. ! #define    EBCDICSW   7
  1753.       "ebcdicsafe", 0,
  1754. ! #define    NEBCDICSW  8
  1755.       "noebcdicsafe", 0,
  1756.   
  1757. ! #define    FILESW     9        /* interface from show */
  1758. !     "file file", 0,
  1759. ! #define    FORMSW       10
  1760.       "form formfile", 4,
  1761.   
  1762. ! #define    HEADSW       11
  1763.       "headers", 0,
  1764. ! #define    NHEADSW      12
  1765.       "noheaders", 0,
  1766.   
  1767. ! #define    LISTSW      13
  1768.       "list", 0,
  1769. ! #define    NLISTSW      14
  1770.       "nolist", 0,
  1771.   
  1772. ! #define    PARTSW      15
  1773.       "part number", 0,
  1774.   
  1775. ! #define    PAUSESW      16
  1776.       "pause", 0,
  1777. ! #define    NPAUSESW  17
  1778.       "nopause", 0,
  1779.   
  1780. ! #define    RCACHESW  18
  1781. !     "rcache policy", 0,
  1782. ! #define    SIZESW      19
  1783.       "realsize", 0,
  1784. ! #define    NSIZESW      20
  1785.       "norealsize", 0,
  1786.   
  1787. ! #define    RFC934SW  21
  1788.       "rfc934mode", 0,
  1789. ! #define    NRFC934SW 22
  1790.       "norfc934mode", 0,
  1791.   
  1792. ! #define    SERIALSW  23
  1793.       "serialonly", 0,
  1794. ! #define    NSERIALSW 24
  1795.       "noserialonly", 0,
  1796.   
  1797. ! #define    SHOWSW      25
  1798.       "show", 0,
  1799. ! #define    NSHOWSW      26
  1800.       "noshow", 0,
  1801.   
  1802. ! #define    STORESW      27
  1803.       "store", 0,
  1804. ! #define    NSTORESW  28
  1805.       "nostore", 0,
  1806.   
  1807. ! #define    TYPESW      29
  1808.       "type content", 0,
  1809.   
  1810. ! #define    VERBSW      30
  1811.       "verbose", 0,
  1812. ! #define    NVERBSW      31
  1813.       "noverbose", 0,
  1814. + #define    WCACHESW  32
  1815. +     "wcache policy", 0,
  1816.       
  1817. ! #define    HELPSW     33
  1818.       "help", 4,
  1819.   
  1820. ! #define    PROGSW   34
  1821.       "moreproc program", -4,
  1822. ! #define    NPROGSW     35
  1823.       "nomoreproc", -3,
  1824.   
  1825. ! #define    LENSW     36
  1826.       "length lines", -4,
  1827. ! #define    WIDSW     37
  1828.       "width columns", -4,
  1829.   
  1830. ! #define    VIAMSW     38
  1831.       "viamail mailpath", -7,
  1832. ! #define    VIASSW     39
  1833.       "viasubj subject", -7,
  1834. ! #define    VIAPSW     40
  1835.       "viaparm arguments", -7,
  1836. ! #define    VIADSW     41
  1837.       "viadesc text", -7,
  1838. ! #define    VIACSW     42
  1839.       "viacmnt text", -7,
  1840. ! #define    VIAZSW     43
  1841.       "viadelay seconds", -8,
  1842. ! #define    VIAFSW     44
  1843.       "viafrom mailpath", -7,
  1844.   
  1845.       NULL, 0
  1846. ***************
  1847. *** 136,153 ****
  1848.   #define    NTYPES    20
  1849.   
  1850.   static struct swit caches[] = {
  1851. ! #define    CACHE_ALWAYS    0
  1852. !     "always", 0,
  1853. ! #define    CACHE_ASK    1
  1854. !     "ask", 0,
  1855. ! #define    CACHE_NEVER    2
  1856.       "never", 0,
  1857.   
  1858.       NULL, 0
  1859.   };
  1860.   
  1861.   static    int    autosw = 0;
  1862. ! static    int    cachesw = CACHE_ASK;
  1863.   static    int    checksw = 0;
  1864.       int    debugsw = 0;
  1865.   static    int    ebcdicsw = 0;
  1866. --- 145,164 ----
  1867.   #define    NTYPES    20
  1868.   
  1869.   static struct swit caches[] = {
  1870. ! #define    CACHE_NEVER    0
  1871.       "never", 0,
  1872. + #define    CACHE_PRIVATE    1
  1873. +     "private", 0,
  1874. + #define    CACHE_PUBLIC    2
  1875. +     "public", 0,
  1876. + #define    CACHE_ASK    3
  1877. +     "ask", 0,
  1878.   
  1879.       NULL, 0
  1880.   };
  1881.   
  1882.   static    int    autosw = 0;
  1883. ! static    int    cachesw = 0;
  1884.   static    int    checksw = 0;
  1885.       int    debugsw = 0;
  1886.   static    int    ebcdicsw = 0;
  1887. ***************
  1888. *** 154,164 ****
  1889. --- 165,177 ----
  1890.   static    char   *formsw = NULLCP;
  1891.   static    int    headsw = 1;
  1892.   static    int    listsw = 0;
  1893. + static    int    nolist = 0;
  1894.   static    int    nomore = 0;
  1895.   static    int    npart = 0;
  1896.   static    char   *parts[NPARTS + 1];
  1897.   static    int    pausesw = 1;
  1898.   static    char   *progsw = NULLCP;
  1899. + static    int    rcachesw = CACHE_ASK;
  1900.   static    int    rfc934sw = 1;
  1901.   static    int    serialsw = 0;
  1902.   static    int    showsw = 0;
  1903. ***************
  1904. *** 167,172 ****
  1905. --- 180,186 ----
  1906.   static    int    ntype = 0;
  1907.   static    char   *types[NTYPES + 1];
  1908.       int    verbosw = 0;
  1909. + static    int    wcachesw = CACHE_ASK;
  1910.   
  1911.   static    int    endian = 0;
  1912.   static  char   *mm_charset = NULL;
  1913. ***************
  1914. *** 174,180 ****
  1915.   static    int    xpid = 0;
  1916.   static    int    userrs = 0;
  1917.   
  1918. ! static    char   *cache;
  1919.   static    int    cwdlen;
  1920.   static    char   *cwd;
  1921.   static    char   *dir;
  1922. --- 188,195 ----
  1923.   static    int    xpid = 0;
  1924.   static    int    userrs = 0;
  1925.   
  1926. ! static    char   *cache_public;
  1927. ! static    char   *cache_private;
  1928.   static    int    cwdlen;
  1929.   static    char   *cwd;
  1930.   static    char   *dir;
  1931. ***************
  1932. *** 299,308 ****
  1933.   }    Content, *CT;
  1934.   #define    NULLCT    ((CT) 0)
  1935.   
  1936. ! static CT get_content ();
  1937. ! static int list_content (), show_content (), store_content ();
  1938. ! static int user_content(), compose_content(), output_content();
  1939. ! static void free_content (), flush_errors ();
  1940.   
  1941.   #if    defined(__STDC__) && defined(VSPRINTF)
  1942.   static void content_error (char *, register CT, char *, ...);
  1943. --- 314,324 ----
  1944.   }    Content, *CT;
  1945.   #define    NULLCT    ((CT) 0)
  1946.   
  1947. ! static CT    get_content ();
  1948. ! static int    list_content (), show_content (), store_content ();
  1949. ! static int    cache_content ();
  1950. ! static int    user_content (), compose_content (), output_content ();
  1951. ! static void    free_content (), flush_errors (), set_id ();
  1952.   
  1953.   #if    defined(__STDC__) && defined(VSPRINTF)
  1954.   static void content_error (char *, register CT, char *, ...);
  1955. ***************
  1956. *** 310,320 ****
  1957.   static void content_error ();
  1958.   #endif
  1959.   
  1960. ! static int   init_encoding(), type_ok(), copy_some_headers(), set_endian();
  1961.   static int   make_intermediates ();
  1962. ! static int   write7Bit(), writeQuoted(), writeBase64(), writeBase64aux();
  1963.   static int   writeDigest (), readDigest ();
  1964. ! static int   via_mail(), via_post(), pidcheck();
  1965.   
  1966.   static    CT    *cts = NULL;
  1967.   
  1968. --- 326,337 ----
  1969.   static void content_error ();
  1970.   #endif
  1971.   
  1972. ! static int   init_encoding (), type_ok (), copy_some_headers (), set_endian ();
  1973.   static int   make_intermediates ();
  1974. ! static int   find_cache (), find_cache_aux (), find_cache_aux2 ();
  1975. ! static int   write7Bit (), writeQuoted (), writeBase64 (), writeBase64aux ();
  1976.   static int   writeDigest (), readDigest ();
  1977. ! static int   via_mail (), via_post (), pidcheck ();
  1978.   
  1979.   static    CT    *cts = NULL;
  1980.   
  1981. ***************
  1982. *** 333,339 ****
  1983.   {
  1984.       int     f6 = 0,
  1985.           msgp = 0,
  1986. !             msgnum;
  1987.       char   *cp,
  1988.          *f1 = NULL,
  1989.          *f2 = NULL,
  1990. --- 350,357 ----
  1991.   {
  1992.       int     f6 = 0,
  1993.           msgp = 0,
  1994. !             msgnum,
  1995. !        *icachesw;
  1996.       char   *cp,
  1997.          *f1 = NULL,
  1998.          *f2 = NULL,
  1999. ***************
  2000. *** 393,401 ****
  2001.               continue;
  2002.   
  2003.           case CACHESW:
  2004.               if (!(cp = *argp++) || *cp == '-')
  2005.               adios (NULLCP, "missing argument to %s", argp[-2]);
  2006. !             switch (cachesw = smatch (cp, caches)) {
  2007.               case AMBIGSW:
  2008.                   ambigsw (cp, caches);
  2009.                   done (1);
  2010. --- 411,431 ----
  2011.               continue;
  2012.   
  2013.           case CACHESW:
  2014. +             cachesw++;
  2015. +             continue;
  2016. +         case NCACHESW:
  2017. +             cachesw = 0;
  2018. +             continue;
  2019. +         case RCACHESW:
  2020. +             icachesw = &rcachesw;
  2021. +             goto do_cache;
  2022. +         case WCACHESW:
  2023. +             icachesw = &wcachesw;
  2024. + do_cache: ;
  2025.               if (!(cp = *argp++) || *cp == '-')
  2026.               adios (NULLCP, "missing argument to %s", argp[-2]);
  2027. !             switch (*icachesw = smatch (cp, caches)) {
  2028.               case AMBIGSW:
  2029.                   ambigsw (cp, caches);
  2030.                   done (1);
  2031. ***************
  2032. *** 607,613 ****
  2033.       }
  2034.   
  2035.       (void) sprintf (buf, "%s-cache", invo_name);
  2036. !     cache = cachesw != CACHE_NEVER ? m_find (buf) : NULLCP;
  2037.   
  2038.       cwdlen = strlen (cwd = getcpy (pwd ()));
  2039.       (void) sprintf (buf, "%s-storage", invo_name);
  2040. --- 637,648 ----
  2041.       }
  2042.   
  2043.       (void) sprintf (buf, "%s-cache", invo_name);
  2044. !     if ((cache_public = m_find (buf)) && *cache_public != '/')
  2045. !     cache_public = NULL;
  2046. !     (void) sprintf (buf, "%s-private-cache", invo_name);
  2047. !     if (!(cache_private = m_find (buf)))
  2048. !     cache_private = ".cache";
  2049. !     cache_private = getcpy (m_maildir (cache_private));
  2050.   
  2051.       cwdlen = strlen (cwd = getcpy (pwd ()));
  2052.       (void) sprintf (buf, "%s-storage", invo_name);
  2053. ***************
  2054. *** 621,626 ****
  2055. --- 656,662 ----
  2056.       if (msgp == 1
  2057.           && !folder
  2058.           && !npart
  2059. +         && !cachesw
  2060.           && !showsw
  2061.           && !storesw
  2062.           && !ntype
  2063. ***************
  2064. *** 743,749 ****
  2065.       if (!*cts)
  2066.       done (1);
  2067.   
  2068. !     if (!listsw && !showsw && !storesw)
  2069.       showsw++;
  2070.   
  2071.   /* listsw && showsw        -> user wants per-message listing,
  2072. --- 779,785 ----
  2073.       if (!*cts)
  2074.       done (1);
  2075.   
  2076. !     if (!listsw && !showsw && !storesw && !cachesw)
  2077.       showsw++;
  2078.   
  2079.   /* listsw && showsw        -> user wants per-message listing,
  2080. ***************
  2081. *** 757,763 ****
  2082.       (void) signal (SIGPIPE, pipeser);
  2083.   
  2084.       for (ctp = cts; ct = *ctp; ctp++)
  2085. !     if (type_ok (ct)
  2086.               && (ct -> c_ctlistfnx
  2087.                   || ct -> c_ctstorefnx
  2088.                   || ct -> c_ctshowfnx)) {
  2089. --- 793,799 ----
  2090.       (void) signal (SIGPIPE, pipeser);
  2091.   
  2092.       for (ctp = cts; ct = *ctp; ctp++)
  2093. !     if (type_ok (ct, 1)
  2094.               && (ct -> c_ctlistfnx
  2095.                   || ct -> c_ctstorefnx
  2096.                   || ct -> c_ctshowfnx)) {
  2097. ***************
  2098. *** 774,784 ****
  2099.               "description");
  2100.   
  2101.       for (ctp = cts; ct = *ctp; ctp++)
  2102. !         if (type_ok (ct) && ct -> c_ctlistfnx) {
  2103.           (void) umask (ct -> c_umask);
  2104.           (void) (*ct -> c_ctlistfnx) (ct, 1);
  2105.           if (ct -> c_fp)
  2106.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2107.           }
  2108.   
  2109.       flush_errors ();
  2110. --- 810,822 ----
  2111.               "description");
  2112.   
  2113.       for (ctp = cts; ct = *ctp; ctp++)
  2114. !         if (type_ok (ct, 1) && ct -> c_ctlistfnx) {
  2115.           (void) umask (ct -> c_umask);
  2116.           (void) (*ct -> c_ctlistfnx) (ct, 1);
  2117.           if (ct -> c_fp)
  2118.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2119. +         if (ct -> c_ceclosefnx)
  2120. +             (*ct -> c_ceclosefnx) (ct);
  2121.           }
  2122.   
  2123.       flush_errors ();
  2124. ***************
  2125. *** 786,801 ****
  2126.   
  2127.       if (storesw) {
  2128.       for (ctp = cts; ct = *ctp; ctp++)
  2129. !         if (type_ok (ct) && ct -> c_ctstorefnx) {
  2130.           (void) umask (ct -> c_umask);
  2131.           (void) (*ct -> c_ctstorefnx) (ct, NULLCP);
  2132.           if (ct -> c_fp)
  2133.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2134.           }
  2135.   
  2136.       flush_errors ();
  2137.       }
  2138.   
  2139.       if (listsw && !showsw && storesw && sizesw) {
  2140.       if (headsw)
  2141.           printf (LSTFMT1, "msg", "part", "type/subtype", "size",
  2142. --- 824,854 ----
  2143.   
  2144.       if (storesw) {
  2145.       for (ctp = cts; ct = *ctp; ctp++)
  2146. !         if (type_ok (ct, 1) && ct -> c_ctstorefnx) {
  2147.           (void) umask (ct -> c_umask);
  2148.           (void) (*ct -> c_ctstorefnx) (ct, NULLCP);
  2149.           if (ct -> c_fp)
  2150.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2151. +         if (ct -> c_ceclosefnx)
  2152. +             (*ct -> c_ceclosefnx) (ct);
  2153.           }
  2154.   
  2155.       flush_errors ();
  2156.       }
  2157.   
  2158. +     if (cachesw) {
  2159. +     for (ctp = cts; ct = *ctp; ctp++)
  2160. +         if (type_ok (ct, 1)) {
  2161. +         cache_content (ct);
  2162. +         if (ct -> c_fp)
  2163. +             (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2164. +         if (ct -> c_ceclosefnx)
  2165. +             (*ct -> c_ceclosefnx) (ct);
  2166. +         }
  2167. +     flush_errors ();
  2168. +     }
  2169.       if (listsw && !showsw && storesw && sizesw) {
  2170.       if (headsw)
  2171.           printf (LSTFMT1, "msg", "part", "type/subtype", "size",
  2172. ***************
  2173. *** 802,812 ****
  2174.               "description");
  2175.   
  2176.       for (ctp = cts; ct = *ctp; ctp++)
  2177. !         if (type_ok (ct) && ct -> c_ctlistfnx) {
  2178.           (void) umask (ct -> c_umask);
  2179.           (void) (*ct -> c_ctlistfnx) (ct, 1);
  2180.           if (ct -> c_fp)
  2181.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2182.           }
  2183.   
  2184.       flush_errors ();
  2185. --- 855,867 ----
  2186.               "description");
  2187.   
  2188.       for (ctp = cts; ct = *ctp; ctp++)
  2189. !         if (type_ok (ct, 1) && ct -> c_ctlistfnx) {
  2190.           (void) umask (ct -> c_umask);
  2191.           (void) (*ct -> c_ctlistfnx) (ct, 1);
  2192.           if (ct -> c_fp)
  2193.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2194. +         if (ct -> c_ceclosefnx)
  2195. +             (*ct -> c_ceclosefnx) (ct);
  2196.           }
  2197.   
  2198.       flush_errors ();
  2199. ***************
  2200. *** 815,824 ****
  2201.   
  2202.       if (showsw)
  2203.       for (ctp = cts; ct = *ctp; ctp++) {
  2204. -         int        child_id,
  2205. -             i,
  2206. -             vecp;
  2207. -         char   *vec[8];
  2208.   #if defined(BSD42) && !defined(WAITINT)
  2209.           union wait status;
  2210.   #else
  2211. --- 870,875 ----
  2212. ***************
  2213. *** 826,832 ****
  2214.   #endif
  2215.           TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
  2216.   
  2217. !         if (!type_ok (ct))
  2218.           continue;
  2219.   
  2220.           (void) umask (ct -> c_umask);
  2221. --- 877,883 ----
  2222.   #endif
  2223.           TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
  2224.   
  2225. !         if (!type_ok (ct, 0))
  2226.           continue;
  2227.   
  2228.           (void) umask (ct -> c_umask);
  2229. ***************
  2230. *** 843,890 ****
  2231.           if (!ct -> c_ctshowfnx) {
  2232.           if (ct -> c_fp)
  2233.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2234.           continue;
  2235.           }
  2236.   
  2237. !         vecp = 0;
  2238. !         vec[vecp++] = r1bindex (mhlproc, '/');
  2239. !         vec[vecp++] = "-form";
  2240. !         vec[vecp++] = formsw;
  2241. !         vec[vecp++] = "-nobody";
  2242. !         vec[vecp++] = ct -> c_file;
  2243. !         if (nomore)
  2244. !         vec[vecp++] = "-nomoreproc";
  2245. !         else
  2246. !         if (progsw) {
  2247. !             vec[vecp++] = "-moreproc";
  2248. !             vec[vecp++] = progsw;
  2249. !         }
  2250. !         vec[vecp] = NULL;
  2251.   
  2252. !         (void) fflush (stdout);
  2253. !         for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++)
  2254. !         sleep (5);
  2255. !         switch (child_id) {
  2256. !             case NOTOK:
  2257. !             adios ("fork", "unable to");
  2258. !             /* NOTREACHED */
  2259.   
  2260. !         case OK:
  2261. !             (void) execvp (mhlproc, vec);
  2262. !             fprintf (stderr, "unable to exec ");
  2263. !             perror (mhlproc);
  2264. !             _exit (-1);
  2265. !             /* NOTREACHED */
  2266.   
  2267. !         default:
  2268. !             xpid = -child_id;
  2269. !             break;
  2270.           }
  2271.   
  2272.           (void) (*ct -> c_ctshowfnx) (ct, 1, 0);
  2273.           if (ct -> c_fp)
  2274.           (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2275.   
  2276.           hstat = signal (SIGHUP, SIG_IGN);
  2277.           istat = signal (SIGINT, SIG_IGN);
  2278. --- 894,954 ----
  2279.           if (!ct -> c_ctshowfnx) {
  2280.           if (ct -> c_fp)
  2281.               (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2282. +         if (ct -> c_ceclosefnx)
  2283. +             (*ct -> c_ceclosefnx) (ct);
  2284.           continue;
  2285.           }
  2286.   
  2287. !         if (strcmp (formsw, "mhl.null")) {
  2288. !         int    child_id,
  2289. !             i,
  2290. !             vecp;
  2291. !         char   *vec[8];
  2292.   
  2293. !         vecp = 0;
  2294. !         vec[vecp++] = r1bindex (mhlproc, '/');
  2295. !         vec[vecp++] = "-form";
  2296. !         vec[vecp++] = formsw;
  2297. !         vec[vecp++] = "-nobody";
  2298. !         vec[vecp++] = ct -> c_file;
  2299. !         if (nomore)
  2300. !             vec[vecp++] = "-nomoreproc";
  2301. !         else
  2302. !             if (progsw) {
  2303. !             vec[vecp++] = "-moreproc";
  2304. !             vec[vecp++] = progsw;
  2305. !             }
  2306. !         vec[vecp] = NULL;
  2307.   
  2308. !         (void) fflush (stdout);
  2309.   
  2310. !         for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++)
  2311. !             sleep (5);
  2312. !         switch (child_id) {
  2313. !                 case NOTOK:
  2314. !                 adios ("fork", "unable to");
  2315. !             /* NOTREACHED */
  2316. !             case OK:
  2317. !             (void) execvp (mhlproc, vec);
  2318. !             fprintf (stderr, "unable to exec ");
  2319. !             perror (mhlproc);
  2320. !             _exit (-1);
  2321. !             /* NOTREACHED */
  2322. !             default:
  2323. !             xpid = -child_id;
  2324. !             break;
  2325. !         }
  2326.           }
  2327. +         else
  2328. +         xpid = 0;
  2329.   
  2330.           (void) (*ct -> c_ctshowfnx) (ct, 1, 0);
  2331.           if (ct -> c_fp)
  2332.           (void) fclose (ct -> c_fp), ct -> c_fp = NULL;
  2333. +         if (ct -> c_ceclosefnx)
  2334. +         (*ct -> c_ceclosefnx) (ct);
  2335.   
  2336.           hstat = signal (SIGHUP, SIG_IGN);
  2337.           istat = signal (SIGINT, SIG_IGN);
  2338. ***************
  2339. *** 1452,1457 ****
  2340. --- 1516,1541 ----
  2341.           return NOTOK;
  2342.       }
  2343.   
  2344. +     if (magic && *cp == '<') {
  2345. +     if (ct -> c_id)
  2346. +         free (ct -> c_id), ct -> c_id = NULL;
  2347. +     if (!(dp = index (ct -> c_id = ++cp, '>'))) {
  2348. +         advise (NULLCP, "invalid ID in message %s", ct -> c_file);
  2349. +         return NOTOK;
  2350. +     }
  2351. +     
  2352. +     c = *dp, *dp = '\0';
  2353. +     if (*ct -> c_id)
  2354. +         ct -> c_id = concat ("<", ct -> c_id, ">\n", NULLCP);
  2355. +     else
  2356. +         ct -> c_id = NULL;
  2357. +     *dp++ = c, cp = dp;
  2358. +     while (isspace (*cp))
  2359. +         cp++;
  2360. +     }
  2361.       if (magic && *cp == '[') {
  2362.       ct -> c_descr = ++cp;
  2363.       for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
  2364. ***************
  2365. *** 1802,1809 ****
  2366.   
  2367.   /*   */
  2368.   
  2369. ! static int  show_content_aux ();
  2370.   
  2371.   static int  show_content (ct, serial, alternate)
  2372.   register CT    ct;
  2373.   int    serial,
  2374. --- 1886,1894 ----
  2375.   
  2376.   /*   */
  2377.   
  2378. ! static int    show_content_aux (), show_content_aux2 ();
  2379.   
  2380.   static int  show_content (ct, serial, alternate)
  2381.   register CT    ct;
  2382.   int    serial,
  2383. ***************
  2384. *** 1838,1846 ****
  2385.   register char   *cp;
  2386.   char   *cracked;
  2387.   {
  2388. !     int        child_id,
  2389. !         fd,
  2390. !         i,
  2391.           xlist,
  2392.           xpause,
  2393.           xstdin,
  2394. --- 1923,1929 ----
  2395.   register char   *cp;
  2396.   char   *cracked;
  2397.   {
  2398. !     int        fd,
  2399.           xlist,
  2400.           xpause,
  2401.           xstdin,
  2402. ***************
  2403. *** 1847,1855 ****
  2404.           xtty;
  2405.       register char  *bp;
  2406.       char   *file,
  2407. !        *vec[4],
  2408. !         buffer[BUFSIZ],
  2409. !         exec[BUFSIZ + sizeof "exec "];
  2410.       register CI ci = &ct -> c_ctinfo;
  2411.   
  2412.       if (!ct -> c_ceopenfnx) {
  2413. --- 1930,1936 ----
  2414.           xtty;
  2415.       register char  *bp;
  2416.       char   *file,
  2417. !         buffer[BUFSIZ];
  2418.       register CI ci = &ct -> c_ctinfo;
  2419.   
  2420.       if (!ct -> c_ceopenfnx) {
  2421. ***************
  2422. *** 1890,1895 ****
  2423. --- 1971,1985 ----
  2424.               }
  2425.               break;
  2426.   
  2427. +         case 'd':    /* content description */
  2428. +             if (ct -> c_descr) {
  2429. +             char   *s;
  2430. +             (void) strcpy (bp, s = trimcpy (ct -> c_descr));
  2431. +             free (s);
  2432. +             }
  2433. +             break;
  2434.           case 'e':    /* exclusive execution */
  2435.               xtty = 1;
  2436.               break;
  2437. ***************
  2438. *** 1906,1912 ****
  2439.               /* and fall... */
  2440.           case 'l':    /* display listing prior to displaying
  2441.                      content */
  2442. !             xlist = 1;
  2443.               break;
  2444.   
  2445.           case 's':    /* subtype */
  2446. --- 1996,2002 ----
  2447.               /* and fall... */
  2448.           case 'l':    /* display listing prior to displaying
  2449.                      content */
  2450. !             xlist = !nolist;
  2451.               break;
  2452.   
  2453.           case 's':    /* subtype */
  2454. ***************
  2455. *** 1934,1941 ****
  2456. --- 2024,2055 ----
  2457.       (void) strcpy (term, buffer);
  2458.       (void) sprintf (buffer, ct -> c_termproc, term);
  2459.       }
  2460.   got_command: ;
  2461. +     return show_content_aux2 (ct, serial, alternate, cracked, buffer,
  2462. +                   fd, xlist, xpause, xstdin, xtty);
  2463. + }
  2464.   
  2465. + static int  show_content_aux2 (ct, serial, alternate, cracked, buffer,
  2466. +                   fd, xlist, xpause, xstdin, xtty)
  2467. + register CT    ct;
  2468. + int    serial,
  2469. +     alternate;
  2470. + char   *cracked,
  2471. +        *buffer;
  2472. + int    fd,
  2473. +     xlist,
  2474. +         xpause,
  2475. +         xstdin,
  2476. +         xtty;
  2477. + {
  2478. +     int        child_id,
  2479. +         i;
  2480. +     char   *vec[4],
  2481. +         exec[BUFSIZ + sizeof "exec "];
  2482. +     register CI ci = &ct -> c_ctinfo;
  2483. +     
  2484.       if (debugsw || cracked) {
  2485.       (void) fflush (stdout);
  2486.   
  2487. ***************
  2488. *** 1960,1966 ****
  2489.       char    prompt[BUFSIZ];
  2490.   
  2491.       if (ct -> c_ctlistfnx) {
  2492. !         (*ct -> c_ctlistfnx) (ct, -1);
  2493.   
  2494.           if (xpause && SOprintf ("Press <return> to show content..."))
  2495.           printf ("Press <return> to show content...");
  2496. --- 2074,2083 ----
  2497.       char    prompt[BUFSIZ];
  2498.   
  2499.       if (ct -> c_ctlistfnx) {
  2500. !         if (ct -> c_type == CT_MULTIPART)
  2501. !         (void) list_content (ct, -1);
  2502. !         else
  2503. !         (*ct -> c_ctlistfnx) (ct, -1);
  2504.   
  2505.           if (xpause && SOprintf ("Press <return> to show content..."))
  2506.           printf ("Press <return> to show content...");
  2507. ***************
  2508. *** 2054,2060 ****
  2509.           else
  2510.           (void) pidcheck (pidXwait (child_id, NULLCP));
  2511.   
  2512. !         (void) (*ct -> c_ceclosefnx) (ct);
  2513.           return (alternate ? DONE : OK);
  2514.       }
  2515.   }
  2516. --- 2171,2178 ----
  2517.           else
  2518.           (void) pidcheck (pidXwait (child_id, NULLCP));
  2519.   
  2520. !         if (fd != NOTOK)
  2521. !         (void) (*ct -> c_ceclosefnx) (ct);
  2522.           return (alternate ? DONE : OK);
  2523.       }
  2524.   }
  2525. ***************
  2526. *** 2215,2237 ****
  2527.   got_filename: ;
  2528.   
  2529.       ct -> c_storage = add (buffer, NULLCP);
  2530. ! /*
  2531. !     if (debugsw) {
  2532. !  */
  2533. !     (void) fflush (stdout);
  2534. !     fprintf (stderr, "storing message %s", ct -> c_file);
  2535. !     if (ct -> c_partno)
  2536. !         fprintf (stderr, " part %s", ct -> c_partno);
  2537. !     fprintf (stderr, " as file %s\n",
  2538. !          strncmp (ct -> c_storage, cwd, cwdlen)
  2539. !             || ct -> c_storage[cwdlen] != '/'
  2540. !             ? ct -> c_storage
  2541. !             : ct -> c_storage + cwdlen + 1);
  2542. ! /*
  2543. !     }
  2544. !  */
  2545.       if (index (ct -> c_storage, '/')
  2546.           && make_intermediates (ct -> c_storage) == NOTOK)
  2547.       return NOTOK;
  2548. --- 2333,2346 ----
  2549.   got_filename: ;
  2550.   
  2551.       ct -> c_storage = add (buffer, NULLCP);
  2552. !     (void) fflush (stdout);
  2553. !     fprintf (stderr, "storing message %s", ct -> c_file);
  2554. !     if (ct -> c_partno)
  2555. !     fprintf (stderr, " part %s", ct -> c_partno);
  2556. !     fprintf (stderr, " as file %s\n",
  2557. !          strncmp (ct -> c_storage, cwd, cwdlen)
  2558. !             || ct -> c_storage[cwdlen] != '/'
  2559. !              ? ct -> c_storage : ct -> c_storage + cwdlen + 1);
  2560.       if (index (ct -> c_storage, '/')
  2561.           && make_intermediates (ct -> c_storage) == NOTOK)
  2562.       return NOTOK;
  2563. ***************
  2564. *** 2452,2458 ****
  2565.   {
  2566.       register char *cp;
  2567.   
  2568. !     for (cp = file; cp = index (cp, '/'); cp++) {
  2569.       struct stat st;
  2570.   
  2571.       *cp = NULL;
  2572. --- 2561,2567 ----
  2573.   {
  2574.       register char *cp;
  2575.   
  2576. !     for (cp = file + 1; cp = index (cp, '/'); cp++) {
  2577.       struct stat st;
  2578.   
  2579.       *cp = NULL;
  2580. ***************
  2581. *** 2560,2571 ****
  2582.   
  2583.   /*   */
  2584.   
  2585. ! static int  part_ok (ct)
  2586.   register CT    ct;
  2587.   {
  2588.       register char **ap;
  2589.   
  2590. !     if (ct -> c_type == CT_MULTIPART || npart == 0)
  2591.       return 1;
  2592.   
  2593.       for (ap = parts; *ap; ap++)
  2594. --- 2669,2682 ----
  2595.   
  2596.   /*   */
  2597.   
  2598. ! static int  part_ok (ct, sP)
  2599.   register CT    ct;
  2600. + int    sP;
  2601.   {
  2602.       register char **ap;
  2603.   
  2604. !     if ((ct -> c_type == CT_MULTIPART && (sP || ct -> c_subtype))
  2605. !         || npart == 0)
  2606.       return 1;
  2607.   
  2608.       for (ap = parts; *ap; ap++)
  2609. ***************
  2610. *** 2577,2590 ****
  2611.   
  2612.   
  2613.   
  2614. ! static int  type_ok (ct)
  2615.   register CT    ct;
  2616.   {
  2617.       register char **ap;
  2618.       char    buffer[BUFSIZ];
  2619.       register CI        ci = &ct -> c_ctinfo;
  2620.   
  2621. !     if (ct -> c_type == CT_MULTIPART || ntype == 0)
  2622.       return 1;
  2623.   
  2624.       (void) sprintf (buffer, "%s/%s", ci -> ci_type, ci -> ci_subtype);
  2625. --- 2688,2703 ----
  2626.   
  2627.   
  2628.   
  2629. ! static int  type_ok (ct, sP)
  2630.   register CT    ct;
  2631. + int    sP;
  2632.   {
  2633.       register char **ap;
  2634.       char    buffer[BUFSIZ];
  2635.       register CI        ci = &ct -> c_ctinfo;
  2636.   
  2637. !     if ((ct -> c_type == CT_MULTIPART && (sP || ct -> c_subtype))
  2638. !         || ntype == 0)
  2639.       return 1;
  2640.   
  2641.       (void) sprintf (buffer, "%s/%s", ci -> ci_type, ci -> ci_subtype);
  2642. ***************
  2643. *** 2757,2763 ****
  2644.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2645.       register CT  p = part -> mp_part;
  2646.   
  2647. !     if (part_ok (p) && type_ok (p) && p -> c_ctlistfnx)
  2648.           (void) (*p -> c_ctlistfnx) (p, 0);
  2649.       }
  2650.   
  2651. --- 2870,2876 ----
  2652.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2653.       register CT  p = part -> mp_part;
  2654.   
  2655. !     if (part_ok (p, 1) && type_ok (p, 1) && p -> c_ctlistfnx)
  2656.           (void) (*p -> c_ctlistfnx) (p, 0);
  2657.       }
  2658.   
  2659. ***************
  2660. *** 2805,2818 ****
  2661.      alternating -> we are an alternative
  2662.    */
  2663.   
  2664. !     result = OK;
  2665.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2666.       p = part -> mp_part;
  2667.   
  2668. !     if (part_ok (p)
  2669. !             && type_ok (p)
  2670. !             && p -> c_ctshowfnx) {
  2671. !         switch ((*p -> c_ctshowfnx) (p, nowserial, nowalternate)) {
  2672.           case NOTOK:
  2673.               if (alternate && !alternating) {
  2674.               result = NOTOK;
  2675. --- 2918,2932 ----
  2676.      alternating -> we are an alternative
  2677.    */
  2678.   
  2679. !     result = alternate ? NOTOK : OK;
  2680.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2681.       p = part -> mp_part;
  2682.   
  2683. !     if (part_ok (p, 0) && type_ok (p, 0) && p -> c_ctshowfnx) {
  2684. !         int        inneresult;
  2685. !         switch (inneresult = (*p -> c_ctshowfnx) (p, nowserial,
  2686. !                               nowalternate)) {
  2687.           case NOTOK:
  2688.               if (alternate && !alternating) {
  2689.               result = NOTOK;
  2690. ***************
  2691. *** 2826,2833 ****
  2692.               result = DONE;
  2693.               break;
  2694.               }
  2695. !             if (alternate)
  2696.               alternate = nowalternate = 0;
  2697.               continue;
  2698.           }
  2699.           break;
  2700. --- 2940,2950 ----
  2701.               result = DONE;
  2702.               break;
  2703.               }
  2704. !             if (alternate) {
  2705.               alternate = nowalternate = 0;
  2706. +             if (result == NOTOK)
  2707. +                 result = inneresult;
  2708. +             }
  2709.               continue;
  2710.           }
  2711.           break;
  2712. ***************
  2713. *** 2895,2900 ****
  2714. --- 3012,3159 ----
  2715.   }
  2716.   
  2717.   
  2718. + static int  show_unknown_multi (ct, serial, alternate)
  2719. + register CT    ct;
  2720. + int    serial,
  2721. +     alternate;
  2722. + {
  2723. +     int        xlist,
  2724. +         xpause,
  2725. +         xtty;
  2726. +     register char  *bp,
  2727. +            *cp;
  2728. +     char    buffer[BUFSIZ];
  2729. +     register struct multipart *m = (struct multipart *) ct -> c_ctparams;
  2730. +     register struct part *part;
  2731. +     register CI ci = &ct -> c_ctinfo;
  2732. +     register CT  p;
  2733. +     (void) sprintf (buffer, "%s-show-%s/%s", invo_name, ci -> ci_type,
  2734. +             ci -> ci_subtype);
  2735. +     if ((cp = m_find (buffer)) == NULL || *cp == 0) {
  2736. +     (void) sprintf (buffer, "%s-show-%s", invo_name, ci -> ci_type);
  2737. +     if (((cp = m_find (buffer)) == NULL || *cp == 0)
  2738. +             && (cp = ct -> c_showproc) == NULL) {
  2739. +         if (!alternate)
  2740. +         content_error (NULLCP, ct,
  2741. +                    "don't know how to display content");
  2742. +         return NOTOK;
  2743. +     }
  2744. +     }
  2745. +     for (part = m -> mp_parts; part; part = part -> mp_next) {
  2746. +     p = part -> mp_part;
  2747. +     if (!p -> c_ceopenfnx) {
  2748. +         if (!alternate)
  2749. +         content_error (NULLCP, p, "don't know how to decode content");
  2750. +         return NOTOK;
  2751. +     }
  2752. +     if (p -> c_storage == NULL) {
  2753. +         if ((*p -> c_ceopenfnx) (p, &p -> c_storage) == NOTOK)
  2754. +         return NOTOK;
  2755. +         if (p -> c_showproc && strcmp (p -> c_showproc, "true") == 0)
  2756. +         return (alternate ? DONE : OK);
  2757. +         (*p -> c_ceclosefnx) (p);
  2758. +     }
  2759. +     }
  2760. +     xlist = xpause = xtty = 0;
  2761. +     buffer[0] = '\0';
  2762. +     for (bp = buffer; *cp; cp++)
  2763. +     if (*cp == '%') {
  2764. +         switch (*++cp) {
  2765. +         case 'a':    /* additional arguments */
  2766. +             {
  2767. +             register char **ap,
  2768. +                       **ep;
  2769. +             char   *s = "";
  2770. +             for (ap = ci -> ci_attrs, ep = ci -> ci_values;
  2771. +                      *ap;
  2772. +                      ap++, ep++) {
  2773. +                 (void) sprintf (bp, "%s%s=\"%s\"", s, *ap, *ep);
  2774. +                 bp += strlen (bp);
  2775. +                 s = " ";
  2776. +             }
  2777. +             }
  2778. +             break;
  2779. +         case 'd':    /* content description */
  2780. +             if (ct -> c_descr) {
  2781. +             char   *s;
  2782. +             (void) strcpy (bp, s = trimcpy (ct -> c_descr));
  2783. +             free (s);
  2784. +             }
  2785. +             break;
  2786. +         case 'e':    /* exclusive execution */
  2787. +             xtty = 1;
  2788. +             break;
  2789. +         case 'F':    /* %e and %f */
  2790. +             xtty = 1;
  2791. +             /* and fall... */
  2792. +             case 'f':    /* filename(s) */
  2793. +             {
  2794. +             char   *s = "";
  2795. +             
  2796. +             for (part = m -> mp_parts;
  2797. +                      part;
  2798. +                      part = part -> mp_next) {
  2799. +                 p = part -> mp_part;
  2800. +                 (void) sprintf (bp, "%s'%s'", s, p -> c_storage);
  2801. +                 bp += strlen (bp);
  2802. +                 s = " ";
  2803. +             }
  2804. +             }
  2805. +             break;
  2806. +         case 'p':    /* pause prior to displaying content */
  2807. +             xpause = pausesw;
  2808. +             /* and fall... */
  2809. +         case 'l':    /* display listing prior to displaying
  2810. +                    content */
  2811. +             xlist = !nolist;
  2812. +             break;
  2813. +         case 's':    /* subtype */
  2814. +             (void) strcpy (bp, ci -> ci_subtype);
  2815. +             break;
  2816. +         case '%':
  2817. +             goto raw;
  2818. +         default:
  2819. +             *bp++ = *--cp;
  2820. +             *bp = '\0';
  2821. +             continue;
  2822. +         }
  2823. +         bp += strlen (bp);
  2824. +     }
  2825. +         else {
  2826. + raw: ;
  2827. +         *bp++ = *cp;
  2828. +         *bp = '\0';
  2829. +     }
  2830. +     if (ct -> c_termproc) {
  2831. +     char    term[BUFSIZ];
  2832. +     (void) strcpy (term, buffer);
  2833. +     (void) sprintf (buffer, ct -> c_termproc, term);
  2834. +     }
  2835. +     return show_content_aux2 (ct, serial, alternate, NULLCP, buffer,
  2836. +                   NOTOK, xlist, xpause, 0, xtty);
  2837. + }
  2838.   /* ARGSUSED */
  2839.   
  2840.   static int  store_multi (ct, unused)
  2841. ***************
  2842. *** 2909,2916 ****
  2843.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2844.       register CT  p = part -> mp_part;
  2845.   
  2846. !     if (part_ok (p)
  2847. !             && type_ok (p)
  2848.               && p -> c_ctstorefnx
  2849.               && (result = (*p -> c_ctstorefnx) (p, NULLCP)) == OK
  2850.               && ct -> c_subtype == MULTI_ALTERNATE)
  2851. --- 3168,3175 ----
  2852.       for (part = m -> mp_parts; part; part = part -> mp_next) {
  2853.       register CT  p = part -> mp_part;
  2854.   
  2855. !     if (part_ok (p, 1)
  2856. !             && type_ok (p, 1)
  2857.               && p -> c_ctstorefnx
  2858.               && (result = (*p -> c_ctstorefnx) (p, NULLCP)) == OK
  2859.               && ct -> c_subtype == MULTI_ALTERNATE)
  2860. ***************
  2861. *** 3010,3016 ****
  2862.       adios (NULLCP, "out of memory");
  2863.       ct -> c_ctparams = (caddr_t) m;
  2864.       ct -> c_ctlistfnx = list_multi;
  2865. !     ct -> c_ctshowfnx = show_multi;
  2866.       ct -> c_ctstorefnx = store_multi;
  2867.       ct -> c_ctfreefnx = free_multi;
  2868.       
  2869. --- 3269,3276 ----
  2870.       adios (NULLCP, "out of memory");
  2871.       ct -> c_ctparams = (caddr_t) m;
  2872.       ct -> c_ctlistfnx = list_multi;
  2873. !     ct -> c_ctshowfnx = ct -> c_subtype != MULTI_UNKNOWN ? show_multi
  2874. !                              : show_unknown_multi;
  2875.       ct -> c_ctstorefnx = store_multi;
  2876.       ct -> c_ctfreefnx = free_multi;
  2877.       
  2878. ***************
  2879. *** 3335,3347 ****
  2880.       char   *eb_site;
  2881.       char   *eb_dir;
  2882.       char   *eb_mode;
  2883.   
  2884.       char   *eb_server;
  2885.       char   *eb_subject;
  2886.       char   *eb_body;
  2887. -     unsigned long
  2888. -         eb_size;
  2889.   };
  2890.   
  2891.   
  2892. --- 3595,3606 ----
  2893.       char   *eb_site;
  2894.       char   *eb_dir;
  2895.       char   *eb_mode;
  2896. +     unsigned long
  2897. +         eb_size;
  2898.   
  2899.       char   *eb_server;
  2900.       char   *eb_subject;
  2901.       char   *eb_body;
  2902.   };
  2903.   
  2904.   
  2905. ***************
  2906. *** 3482,3488 ****
  2907.       register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  2908.       register CT        p = e -> eb_content;
  2909.   
  2910. !     if (!type_ok (p))
  2911.       return OK;
  2912.   
  2913.       if (p -> c_ctshowfnx)
  2914. --- 3741,3747 ----
  2915.       register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  2916.       register CT        p = e -> eb_content;
  2917.   
  2918. !     if (!type_ok (p, 0))
  2919.       return OK;
  2920.   
  2921.       if (p -> c_ctshowfnx)
  2922. ***************
  2923. *** 3500,3506 ****
  2924.       register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  2925.       register CT        p = e -> eb_content;
  2926.   
  2927. !     if (!type_ok (p))
  2928.       return OK;
  2929.   
  2930.       p -> c_partno = ct -> c_partno;
  2931. --- 3759,3765 ----
  2932.       register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  2933.       register CT        p = e -> eb_content;
  2934.   
  2935. !     if (!type_ok (p, 1))
  2936.       return OK;
  2937.   
  2938.       p -> c_partno = ct -> c_partno;
  2939. ***************
  2940. *** 3660,3667 ****
  2941.               char   *bp;
  2942.               
  2943.               if ((size = ct -> c_end - p -> c_begin) <= 0) {
  2944. !             content_error (NULLCP, ct,
  2945. !                        "empty body for access-type=mail-server");
  2946.               goto no_body;
  2947.               }
  2948.               
  2949. --- 3919,3927 ----
  2950.               char   *bp;
  2951.               
  2952.               if ((size = ct -> c_end - p -> c_begin) <= 0) {
  2953. !             if (!e -> eb_subject)
  2954. !                 content_error (NULLCP, ct,
  2955. !                        "empty body for access-type=mail-server");
  2956.               goto no_body;
  2957.               }
  2958.               
  2959. ***************
  2960. *** 3736,3742 ****
  2961.       return OK;
  2962.   }
  2963.   
  2964.   /*     APPLICATION */
  2965.   
  2966.   #define    APPLICATION_UNKNOWN    0x00
  2967. --- 3996,4001 ----
  2968. ***************
  2969. *** 4151,4156 ****
  2970. --- 4410,4416 ----
  2971.   
  2972.   static int  set_endian ()
  2973.   {
  2974. +     char   *cp;
  2975.       union {
  2976.       long    l;
  2977.       char    c[sizeof (long)];
  2978. ***************
  2979. *** 4163,4168 ****
  2980. --- 4423,4431 ----
  2981.            endian > 0 ? "big" : "little");
  2982.   
  2983.       mm_charset = getenv ("MM_CHARSET");
  2984. +     if ((cp = getenv ("MM_NOASK")) && strcmp (cp, "1") == 0)
  2985. +     nolist = 1, listsw = pausesw = 0;
  2986.   }
  2987.   
  2988.   /*     QUOTED */
  2989. ***************
  2990. *** 4412,4417 ****
  2991. --- 4675,4728 ----
  2992.       return NOTOK;
  2993.       }
  2994.   
  2995. +     if (ct -> c_type == CT_MULTIPART) {
  2996. +     register char **ap,
  2997. +               **ep;
  2998. +     register CI    ci = &ct -> c_ctinfo;
  2999. +     len = 0;
  3000. +     fprintf (ce -> ce_fp, "%s: %s/%s", TYPE_FIELD, ci -> ci_type,
  3001. +          ci -> ci_subtype);
  3002. +     len += strlen (TYPE_FIELD) + 2 + strlen (ci -> ci_type)
  3003. +                    + 1 + strlen (ci -> ci_subtype);
  3004. +     for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++) {
  3005. +         (void) putc (';', ce -> ce_fp);
  3006. +         len++;
  3007. +         (void) sprintf (buffer, "%s=\"%s\"", *ap, *ep);
  3008. +         if (len + 1 + (cc = strlen (buffer)) >= CPERLIN) {
  3009. +         (void) fputs ("\n\t", ce -> ce_fp);
  3010. +         len = 8;
  3011. +         }
  3012. +         else {
  3013. +         (void) putc (' ', ce -> ce_fp);
  3014. +         len++;
  3015. +         }
  3016. +         fprintf (ce -> ce_fp, "%s", buffer);
  3017. +         len += cc;
  3018. +     }
  3019. +     if (ci -> ci_comment) {
  3020. +         if (len + 1 + (cc = 2 + strlen (ci -> ci_comment)) >= CPERLIN) {
  3021. +         (void) fputs ("\n\t", ce -> ce_fp);
  3022. +         len = 8;
  3023. +         }
  3024. +         else {
  3025. +         (void) putc (' ', ce -> ce_fp);
  3026. +         len++;
  3027. +         }
  3028. +         fprintf (ce -> ce_fp, "(%s)", ci -> ci_comment);
  3029. +         len += cc;
  3030. +     }
  3031. +     fprintf (ce -> ce_fp, "\n");
  3032. +     if (ct -> c_id)
  3033. +         fprintf (ce -> ce_fp, "%s:%s", ID_FIELD, ct -> c_id);
  3034. +     if (ct -> c_descr)
  3035. +         fprintf (ce -> ce_fp, "%s:%s", DESCR_FIELD, ct -> c_descr);
  3036. +     fprintf (ce -> ce_fp, "\n");
  3037. +     }
  3038.       if ((len = ct -> c_end - ct -> c_begin) < 0)
  3039.       adios (NULLCP, "internal error(3)");
  3040.   
  3041. ***************
  3042. *** 4480,4486 ****
  3043.   char  **file;
  3044.   int    *fd;
  3045.   {
  3046. !     char   *id;
  3047.   
  3048.       if (ce -> ce_fp) {
  3049.       (void) fseek (ce -> ce_fp, 0L, 0);
  3050. --- 4791,4797 ----
  3051.   char  **file;
  3052.   int    *fd;
  3053.   {
  3054. !     char    cachefile[BUFSIZ];
  3055.   
  3056.       if (ce -> ce_fp) {
  3057.       (void) fseek (ce -> ce_fp, 0L, 0);
  3058. ***************
  3059. *** 4499,4545 ****
  3060.       goto ready_already;
  3061.       }
  3062.   
  3063. !     if (xpid) {
  3064. !     if (xpid < 0)
  3065. !         xpid = -xpid;
  3066. !     (void) pidcheck (pidwait (xpid, NOTOK));
  3067. !     xpid = 0;
  3068. !     }
  3069. !     if (cache && (id = cb -> c_id)) {
  3070. !     char    buffer[BUFSIZ];
  3071. !     (void) sprintf (buffer, "%s/%s", cache, id = trimcpy (id));
  3072. !     free (id);
  3073. !     id = getcpy (buffer);
  3074. !     if (ce -> ce_fp = fopen (id, "r")) {
  3075. !         char   *bp;
  3076. !         struct stat    st;
  3077. !         if (cachesw == CACHE_ALWAYS)
  3078. !         goto do_cache;
  3079. !         (void) fstat (fileno (ce -> ce_fp), &st);
  3080. !         (void) sprintf (bp = buffer,
  3081. !                 "Use cached copy %s of size %lu octets",
  3082. !                 id, (unsigned long) st.st_size);
  3083. !         bp += strlen (bp);
  3084. !         if (ct -> c_partno) {
  3085. !         (void) sprintf (bp, " (content %s)", ct -> c_partno);
  3086. !         bp += strlen (bp);
  3087. !         }
  3088. !         (void) sprintf (bp, "? ");
  3089. !         if (getanswer (buffer)) {
  3090. ! do_cache: ;
  3091. !         ce -> ce_unlink = 0;
  3092. !         ce -> ce_file = id;
  3093. !         goto ready_already;
  3094. !         }
  3095. !         (void) fclose (ce -> ce_fp), ce -> ce_fp = NULL;
  3096.       }
  3097. !     free (id);
  3098.       }
  3099.   
  3100.       return OK;
  3101. --- 4810,4823 ----
  3102.       goto ready_already;
  3103.       }
  3104.   
  3105. !     if (find_cache (ct, rcachesw, (int *) 0, cb -> c_id, cachefile) != NOTOK) {
  3106. !     if (ce -> ce_fp = fopen (cachefile, "r")) {
  3107. !         ce -> ce_unlink = 0;
  3108. !         ce -> ce_file = getcpy (cachefile);
  3109. !         goto ready_already;
  3110.       }
  3111. !     else
  3112. !         admonish (cachefile, "unable to fopen for reading");
  3113.       }
  3114.   
  3115.       return OK;
  3116. ***************
  3117. *** 4551,4558 ****
  3118.   register CT    ct;
  3119.   char  **file;
  3120.   {
  3121. !     int        fd;
  3122. !     char   *id;
  3123.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  3124.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  3125.   
  3126. --- 4829,4837 ----
  3127.   register CT    ct;
  3128.   char  **file;
  3129.   {
  3130. !     int        fd,
  3131. !         cachetype;
  3132. !     char    cachefile[BUFSIZ];
  3133.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  3134.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  3135.   
  3136. ***************
  3137. *** 4579,4625 ****
  3138.       return NOTOK;
  3139.       }
  3140.   
  3141. !     if (cache
  3142. !         && (id = e -> eb_content -> c_id)
  3143. !         && (!e -> eb_permission
  3144. !             || !uleq (e -> eb_permission, "read-write"))) {
  3145. !     char    buffer[BUFSIZ];
  3146.   
  3147. !     (void) sprintf (buffer, "Make cached, publically-accessible copy of %s? ",
  3148. !             e -> eb_name);
  3149. !     if (cachesw == CACHE_ALWAYS || getanswer (buffer)) {
  3150. !         int        mask;
  3151. !         char    cachefile[BUFSIZ];
  3152. !         FILE   *fp;
  3153.   
  3154. !         (void) sprintf (cachefile, "%s/%s", cache, id = trimcpy (id));
  3155. !         free (id);
  3156.   
  3157. !         mask = umask (0022);
  3158. !         if (fp = fopen (cachefile, "w")) {
  3159. !         int    cc;
  3160. !         register FILE   *gp = ce -> ce_fp;
  3161.   
  3162. !         (void) fseek (gp, 0L, 0);
  3163. !         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer,
  3164. !                     gp)) > 0)
  3165. !             (void) fwrite (buffer, sizeof *buffer, cc, fp);
  3166. !         (void) fflush (fp);
  3167. !         if (ferror (gp)) {
  3168. !             admonish (ce -> ce_file, "error reading");
  3169. !             (void) unlink (cachefile);
  3170. !         }
  3171.           if (ferror (fp)) {
  3172.               admonish (cachefile, "error writing");
  3173.               (void) unlink (cachefile);
  3174.           }
  3175. !         (void) fclose (fp);
  3176. !         }
  3177. !         (void) umask (mask);
  3178.       }
  3179.       }
  3180.   
  3181.       (void) fseek (ce -> ce_fp, 0L, 0);
  3182. --- 4858,4894 ----
  3183.       return NOTOK;
  3184.       }
  3185.   
  3186. !     if ((!e -> eb_permission || !uleq (e -> eb_permission, "read-write"))
  3187. !         && find_cache (NULLCT, wcachesw, &cachetype,
  3188. !                e -> eb_content -> c_id, cachefile) != NOTOK) {
  3189. !     int    mask;
  3190. !     FILE   *fp;
  3191.   
  3192. !     mask = umask (cachetype ? ~m_gmprot () : 0222);
  3193. !     if (fp = fopen (cachefile, "w")) {
  3194. !         int        cc;
  3195. !         char    buffer[BUFSIZ];
  3196. !         FILE   *gp = ce -> ce_fp;
  3197.   
  3198. !         (void) fseek (gp, 0L, 0);
  3199.   
  3200. !         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer, gp))
  3201. !                > 0)
  3202. !         (void) fwrite (buffer, sizeof *buffer, cc, fp);
  3203. !         (void) fflush (fp);
  3204.   
  3205. !         if (ferror (gp)) {
  3206. !         admonish (ce -> ce_file, "error reading");
  3207. !         (void) unlink (cachefile);
  3208. !         }
  3209. !         else
  3210.           if (ferror (fp)) {
  3211.               admonish (cachefile, "error writing");
  3212.               (void) unlink (cachefile);
  3213.           }
  3214. !         (void) fclose (fp);
  3215.       }
  3216. +     (void) umask (mask);
  3217.       }
  3218.   
  3219.       (void) fseek (ce -> ce_fp, 0L, 0);
  3220. ***************
  3221. *** 4633,4642 ****
  3222.   register CT    ct;
  3223.   char  **file;
  3224.   {
  3225. !     int        caching,
  3226.           fd;
  3227. !     char   *ftp,
  3228. !            *id,
  3229.          *user,
  3230.          *pass,
  3231.           buffer[BUFSIZ],
  3232. --- 4902,4912 ----
  3233.   register CT    ct;
  3234.   char  **file;
  3235.   {
  3236. !     int        cachetype,
  3237. !         caching,
  3238.           fd;
  3239. !     char   *bp,
  3240. !        *ftp,
  3241.          *user,
  3242.          *pass,
  3243.           buffer[BUFSIZ],
  3244. ***************
  3245. *** 4670,4682 ****
  3246.       return NOTOK;
  3247.       }
  3248.   
  3249. !     (void) sprintf (buffer,
  3250. !             e -> eb_size > 0
  3251. !             ? "Retrieve %s (content %s)\n    using %sFTP from site %s (%lu octets)? "
  3252. !             : "Retrieve %s (content %s)\n    using %sFTP from site %s? ",
  3253. !             e -> eb_name, e -> eb_partno,
  3254. !             e -> eb_flags ? "anonymous " : "",
  3255. !             e -> eb_site, e -> eb_size);
  3256.       if (!getanswer (buffer))
  3257.       return NOTOK;
  3258.   
  3259. --- 4940,4967 ----
  3260.       return NOTOK;
  3261.       }
  3262.   
  3263. !     if (xpid) {
  3264. !     if (xpid < 0)
  3265. !         xpid = -xpid;
  3266. !     (void) pidcheck (pidwait (xpid, NOTOK));
  3267. !     xpid = 0;
  3268. !     }
  3269. !     bp = buffer;
  3270. !     (void) sprintf (bp, "Retrieve %s", e -> eb_name);
  3271. !     bp += strlen (bp);
  3272. !     if (e -> eb_partno) {
  3273. !     (void) sprintf (bp, " (content %s)", e -> eb_partno);
  3274. !     bp += strlen (bp);
  3275. !     }
  3276. !     (void) sprintf (bp, "\n    using %sFTP from site %s",
  3277. !             e -> eb_flags ? "anonymous " : "", e -> eb_site);
  3278. !     bp += strlen (bp);
  3279. !     if (e -> eb_size > 0) {
  3280. !     (void) sprintf (bp, " (%lu octets)", e -> eb_size);
  3281. !     bp += strlen (bp);
  3282. !     }
  3283. !     (void) sprintf (bp, "? ");
  3284.       if (!getanswer (buffer))
  3285.       return NOTOK;
  3286.   
  3287. ***************
  3288. *** 4690,4708 ****
  3289.       }
  3290.   
  3291.       ce -> ce_unlink = *file == NULL, caching = 0, cachefile[0] = 0;
  3292. !     if (cache
  3293. !         && (id = e -> eb_content -> c_id)
  3294. !         && (!e -> eb_permission
  3295. !             || !uleq (e -> eb_permission, "read-write"))) {
  3296. !     (void) sprintf (buffer, "Make cached, publically-accessible copy? ");
  3297. !     if (cachesw == CACHE_ALWAYS || getanswer (buffer)) {
  3298. !         (void) sprintf (cachefile, "%s/%s", cache, id = trimcpy (id));
  3299. !         free (id);
  3300. !         if (*file == NULL) {
  3301. !         ce -> ce_unlink = 0;
  3302. !         caching = 1;
  3303. !         }
  3304.       }
  3305.       }
  3306.   
  3307. --- 4975,4986 ----
  3308.       }
  3309.   
  3310.       ce -> ce_unlink = *file == NULL, caching = 0, cachefile[0] = 0;
  3311. !     if ((!e -> eb_permission || !uleq (e -> eb_permission, "read-write"))
  3312. !         && find_cache (NULLCT, wcachesw, &cachetype,
  3313. !                e -> eb_content -> c_id, cachefile) != NOTOK) {
  3314. !     if (*file == NULL) {
  3315. !         ce -> ce_unlink = 0;
  3316. !         caching = 1;
  3317.       }
  3318.       }
  3319.   
  3320. ***************
  3321. *** 4717,4723 ****
  3322.       return NOTOK;
  3323.       }
  3324.   
  3325.   #ifdef    FTP
  3326.       if (ftp)
  3327.   #endif
  3328. --- 4995,5000 ----
  3329. ***************
  3330. *** 4779,4797 ****
  3331.   
  3332.       if (cachefile[0])
  3333.       if (caching)
  3334. !         (void) chmod (cachefile, 0644);
  3335.       else {
  3336.           int        mask;
  3337. !         register FILE   *fp;
  3338.   
  3339. !         mask = umask (0022);
  3340.           if (fp = fopen (cachefile, "w")) {
  3341. !         register FILE   *gp = ce -> ce_fp;
  3342.   
  3343.           (void) fseek (gp, 0L, 0);
  3344.   
  3345. !         while (fgets (buffer, sizeof buffer - 1, gp))
  3346. !             (void) fputs (buffer, fp);
  3347.           (void) fflush (fp);
  3348.   
  3349.           if (ferror (gp)) {
  3350. --- 5056,5076 ----
  3351.   
  3352.       if (cachefile[0])
  3353.       if (caching)
  3354. !         (void) chmod (cachefile, cachetype ? m_gmprot () : 0444);
  3355.       else {
  3356.           int        mask;
  3357. !         FILE   *fp;
  3358.   
  3359. !         mask = umask (cachetype ? ~m_gmprot () : 0222);
  3360.           if (fp = fopen (cachefile, "w")) {
  3361. !         int    cc;
  3362. !         FILE   *gp = ce -> ce_fp;
  3363.   
  3364.           (void) fseek (gp, 0L, 0);
  3365.   
  3366. !         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer, gp))
  3367. !                    > 0)
  3368. !             (void) fwrite (buffer, sizeof *buffer, cc, fp);
  3369.           (void) fflush (fp);
  3370.   
  3371.           if (ferror (gp)) {
  3372. ***************
  3373. *** 4798,4808 ****
  3374.               admonish (ce -> ce_file, "error reading");
  3375.               (void) unlink (cachefile);
  3376.           }
  3377. !         if (ferror (fp)) {
  3378. !             admonish (cachefile, "error writing");
  3379. !             (void) unlink (cachefile);
  3380. !         }
  3381.           (void) fclose (fp);
  3382.           }
  3383.           (void) umask (mask);
  3384. --- 5077,5087 ----
  3385.               admonish (ce -> ce_file, "error reading");
  3386.               (void) unlink (cachefile);
  3387.           }
  3388. !         else
  3389. !             if (ferror (fp)) {
  3390. !             admonish (cachefile, "error writing");
  3391. !             (void) unlink (cachefile);
  3392. !             }
  3393.           (void) fclose (fp);
  3394.           }
  3395.           (void) umask (mask);
  3396. ***************
  3397. *** 4822,4831 ****
  3398.       int        child_id,
  3399.           fd,
  3400.           i,
  3401. -         result,
  3402.           vecp;
  3403.       char   *bp,
  3404. -        *id,
  3405.           buffer[BUFSIZ],
  3406.          *vec[7];
  3407.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  3408. --- 5101,5108 ----
  3409. ***************
  3410. *** 4847,4860 ****
  3411.       return NOTOK;
  3412.       }
  3413.   
  3414. !     bp = concat ("Retrieve content ", e -> eb_partno, " by asking mailbox ",
  3415. !          e -> eb_server, "\n\n",
  3416. !          e -> eb_subject ? e -> eb_subject: e -> eb_body, "\n? ",
  3417. !          NULLCP);
  3418. !     result = getanswer (bp);
  3419. !     free (bp);
  3420.   
  3421. !     if (!result)
  3422.       return NOTOK;
  3423.   
  3424.       vecp = 0;
  3425. --- 5124,5147 ----
  3426.       return NOTOK;
  3427.       }
  3428.   
  3429. !     if (xpid) {
  3430. !     if (xpid < 0)
  3431. !         xpid = -xpid;
  3432. !     (void) pidcheck (pidwait (xpid, NOTOK));
  3433. !     xpid = 0;
  3434. !     }
  3435.   
  3436. !     bp = buffer;
  3437. !     (void) sprintf (bp, "Retrieve content");
  3438. !     bp += strlen (bp);
  3439. !     if (e -> eb_partno) {
  3440. !     (void) sprintf (bp, " %s", e -> eb_partno);
  3441. !     bp += strlen (bp);
  3442. !     }
  3443. !     (void) sprintf (bp, " by asking %s\n\n%s\n? ",
  3444. !             e -> eb_server,
  3445. !             e -> eb_subject ? e -> eb_subject : e -> eb_body);
  3446. !     if (!getanswer (buffer))
  3447.       return NOTOK;
  3448.   
  3449.       vecp = 0;
  3450. ***************
  3451. *** 4861,4881 ****
  3452.       vec[vecp++] = r1bindex (mailproc, '/');
  3453.       vec[vecp++] = e -> eb_server;
  3454.       vec[vecp++] = "-subject";
  3455. !     if (e -> eb_subject)
  3456. !     vec[vecp++] = "mail-server request";
  3457. !     else
  3458. !     if (cache
  3459. !             && (id = e -> eb_content -> c_id)
  3460. !             && (!e -> eb_permission
  3461. !                 || !uleq (e -> eb_permission, "read-write"))) {
  3462. !         (void) sprintf (buffer, "cache content as %s/%s", cache,
  3463. !                 id = trimcpy (id));
  3464. !         free (id);
  3465. !         vec[vecp++] = buffer;
  3466. !     }
  3467. !     else
  3468. !         vec[vecp++] = "mail-server request";
  3469.       vec[vecp++] = "-body";
  3470.       vec[vecp++] = e -> eb_body;
  3471.       vec[vecp] = NULL;
  3472. --- 5148,5154 ----
  3473.       vec[vecp++] = r1bindex (mailproc, '/');
  3474.       vec[vecp++] = e -> eb_server;
  3475.       vec[vecp++] = "-subject";
  3476. !     vec[vecp++] = e -> eb_subject ? e -> eb_subject : "mail-server request";
  3477.       vec[vecp++] = "-body";
  3478.       vec[vecp++] = e -> eb_body;
  3479.       vec[vecp] = NULL;
  3480. ***************
  3481. *** 4918,4923 ****
  3482. --- 5191,5538 ----
  3483.       return fileno (ce -> ce_fp);
  3484.   }
  3485.   
  3486. + /*     CACHE */
  3487. + static int  find_cache (ct, policy, writing, id, buffer)
  3488. + CT    ct;
  3489. + int    policy,
  3490. +        *writing;
  3491. + char   *id,
  3492. +        *buffer;
  3493. + {
  3494. +     int        status = NOTOK;
  3495. +     if (id == NULL)
  3496. +     return NOTOK;
  3497. +     id = trimcpy (id);
  3498. +     if (debugsw)
  3499. +     fprintf (stderr, "find_cache %s(%d) %s %s\n",
  3500. +          caches[policy].sw, policy, writing ? "writing" : "reading",
  3501. +          id);
  3502. +     switch (policy) {
  3503. +     case CACHE_NEVER:
  3504. +     default:
  3505. +         break;
  3506. +     case CACHE_ASK:
  3507. +     case CACHE_PUBLIC:
  3508. +         if (cache_private
  3509. +             && !writing
  3510. +             && find_cache_aux (writing ? 2 : 0, cache_private, id,
  3511. +                        buffer) == OK) {
  3512. +         if (access (buffer, 04) != NOTOK) {
  3513. + got_private: ;
  3514. +             if (writing)
  3515. +             *writing = 1;
  3516. + got_it: ; 
  3517. +             status = OK;
  3518. +             break;
  3519. +         }
  3520. +         }
  3521. +         if (cache_public
  3522. +             && find_cache_aux (writing ? 1 : 0, cache_public, id,
  3523. +                        buffer) == OK) {
  3524. +         if (writing || access (buffer, 04) != NOTOK) {
  3525. +             if (writing)
  3526. +             *writing = 0;
  3527. +             goto got_it;
  3528. +         }
  3529. +         }
  3530. +         break;
  3531. +     case CACHE_PRIVATE:
  3532. +         if (cache_private
  3533. +             && find_cache_aux (writing ? 2 : 0, cache_private, id,
  3534. +                        buffer) == OK) {
  3535. +         if (writing || access (buffer, 04) != NOTOK)
  3536. +             goto got_private;
  3537. +         }
  3538. +         break;
  3539. +     }
  3540. +     if (status == OK && policy == CACHE_ASK) {
  3541. +     char   *bp,
  3542. +         query[BUFSIZ];
  3543. +     if (xpid) {
  3544. +         if (xpid < 0)
  3545. +         xpid = -xpid;
  3546. +         (void) pidcheck (pidwait (xpid, NOTOK));
  3547. +         xpid = 0;
  3548. +     }
  3549. +     bp = query;
  3550. +     if (writing)
  3551. +         (void) sprintf (bp, "Make cached, publically-accessible copy");
  3552. +     else {
  3553. +         struct stat st;
  3554. +         (void) sprintf (bp, "Use cached copy");
  3555. +         bp += strlen (bp);
  3556. +         if (ct -> c_partno) {
  3557. +         (void) sprintf (bp, " of content %s", ct -> c_partno);
  3558. +         bp += strlen (bp);
  3559. +         }
  3560. +         (void) stat (buffer, &st);
  3561. +         (void) sprintf (bp, " (size %lu octets)",
  3562. +                 (unsigned long) st.st_size);
  3563. +     }
  3564. +     bp += strlen (bp);
  3565. +     (void) sprintf (bp, "\n    in file %s? ", buffer);
  3566. +     if (!getanswer (query))
  3567. +         status = NOTOK;
  3568. +     }
  3569. +     if (status == OK && writing) {
  3570. +     if (*writing && index (buffer, '/'))
  3571. +         (void) make_intermediates (buffer);
  3572. +     (void) unlink (buffer);
  3573. +     }
  3574. +     free (id);
  3575. +     return status;
  3576. + }
  3577. + /*   */
  3578. + static int  find_cache_aux (writing, directory, id, buffer)
  3579. + int    writing;
  3580. + char   *directory,
  3581. +        *id,
  3582. +        *buffer;
  3583. + {
  3584. +     int        mask;
  3585. + #ifdef    BSD42
  3586. +     int        usemap = index (id, '/') ? 1 : 0;
  3587. + #else
  3588. +     int        usemap = 1;
  3589. + #endif
  3590. +     char    mapfile[BUFSIZ],
  3591. +         mapname[BUFSIZ];
  3592. +     FILE   *fp;
  3593. +     static int    partno,
  3594. +         pid;
  3595. +     static long clock = 0L;
  3596. +     if (debugsw)
  3597. +     fprintf (stderr, "find_cache_aux %s usemap=%d\n", directory, usemap);
  3598. +     (void) sprintf (mapfile, "%s/cache.map", directory);
  3599. +     if (find_cache_aux2 (mapfile, id, mapname) == OK)
  3600. +     goto done_map;
  3601. +     if (!writing) {
  3602. +     if (usemap)
  3603. +         return NOTOK;
  3604. + use_raw: ;
  3605. +     (void) sprintf (buffer, "%s/%s", directory, id);
  3606. +     return OK;
  3607. +     }
  3608. +     if (!usemap && access (mapfile, 02) == NOTOK)
  3609. +     goto use_raw;
  3610. +     if (clock != 0L) {
  3611. +     long    now;
  3612. +     
  3613. +     (void) time (&now);
  3614. +     if (now > clock)
  3615. +         clock = 0L;
  3616. +     }
  3617. +     else
  3618. +     pid = getpid ();
  3619. +     if (clock == 0L) {
  3620. +     (void) time (&clock);
  3621. +     partno = 0;
  3622. +     }
  3623. +     else
  3624. +     if (partno > 0xff)
  3625. +         clock++, partno = 0;
  3626. +     (void) sprintf (mapname, "%08x%04x%02x", clock & 0xffffffff,
  3627. +             pid & 0xffff, partno++ & 0xff);
  3628. +     if (debugsw)
  3629. +     fprintf (stderr, "creating mapping %s -> %s\n", mapname, id);
  3630. +     (void) make_intermediates (mapfile);
  3631. +     mask = umask (writing == 2 ? 0077 : 0);
  3632. +     if (!(fp = lkfopen (mapfile, "a")) && errno == ENOENT) {
  3633. +     int    fd = creat (mapfile, 0666);
  3634. +     if (fd != NOTOK) {
  3635. +         (void) close (fd);
  3636. +         fp = lkfopen (mapfile, "a");
  3637. +     }
  3638. +     }
  3639. +     (void) umask (mask);
  3640. +     if (!fp)
  3641. +     return NOTOK;
  3642. +     fprintf (fp, "%s: %s\n", mapname, id);
  3643. +     (void) lkfclose (fp, mapfile);
  3644. + done_map: ;
  3645. +     if (*mapname == '/')
  3646. +     (void) strcpy (buffer, mapname);
  3647. +     else
  3648. +     (void) sprintf (buffer, "%s/%s", directory, mapname);
  3649. +     if (debugsw)
  3650. +     fprintf (stderr, "use %s\n", buffer);
  3651. +     return OK;
  3652. + }
  3653. + /*   */
  3654. + static int  find_cache_aux2 (mapfile, id, mapname)
  3655. + char   *mapfile,
  3656. +        *id,
  3657. +        *mapname;
  3658. + {
  3659. +     int        state;
  3660. +     char    buf[BUFSIZ],
  3661. +         name[NAMESZ];
  3662. +     FILE   *fp;
  3663. +     if (!(fp = lkfopen (mapfile, "r")))
  3664. +     return NOTOK;
  3665. +     for (state = FLD;;) {
  3666. +     int    result;
  3667. +     register char  *cp,
  3668. +                *dp;
  3669. +     switch (state = m_getfld (state, name, buf, sizeof buf, fp)) {
  3670. +         case FLD:
  3671. +         case FLDPLUS:
  3672. +         case FLDEOF:
  3673. +             (void) strcpy (mapname, name);
  3674. +         if (state != FLDPLUS)
  3675. +             cp = buf;
  3676. +         else {
  3677. +             cp = add (buf, NULLCP);
  3678. +             while (state == FLDPLUS) {
  3679. +             state = m_getfld (state, name, buf, sizeof buf, fp);
  3680. +             cp = add (buf, cp);
  3681. +             }
  3682. +         }
  3683. +         dp = trimcpy (cp);
  3684. +         if (cp != buf)
  3685. +             free (cp);
  3686. +         if (debugsw)
  3687. +             fprintf (stderr, "compare %s to %s <- %s\n", id, dp,
  3688. +                  mapname);
  3689. +         result = strcmp (id, dp);
  3690. +         free (dp);
  3691. +         if (result == 0) {
  3692. +             (void) lkfclose (fp, mapfile);
  3693. +             return OK;
  3694. +         }
  3695. +         if (state != FLDEOF)
  3696. +             continue;
  3697. +         /* else fall... */
  3698. +         case BODY:
  3699. +         case BODYEOF:
  3700. +         case FILEEOF:
  3701. +         default:
  3702. +         break;
  3703. +     }
  3704. +     break;
  3705. +     }
  3706. +     (void) lkfclose (fp, mapfile);
  3707. +     return NOTOK;
  3708. + }
  3709. + /*   */
  3710. + static int  cache_content (ct)
  3711. + register CT    ct;
  3712. + {
  3713. +     int        cachetype;
  3714. +     char   *file,
  3715. +         cachefile[BUFSIZ];
  3716. +     register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  3717. +     if (!ct -> c_id) {
  3718. +     advise (NULLCP, "no %s: field in %s", ID_FIELD, ct -> c_file);
  3719. +     return;
  3720. +     }
  3721. +     if (!ce) {
  3722. +     advise (NULLCP, "unable to decode %s", ct -> c_file);
  3723. +     return;
  3724. +     }
  3725. +     if (ct -> c_ceopenfnx == openMail) {
  3726. +     advise (NULLCP, "a radish may no know Greek, but I do...");
  3727. +     return;
  3728. +     }
  3729. +     if (find_cache (NULLCT, wcachesw != CACHE_NEVER ? wcachesw : CACHE_ASK,
  3730. +             &cachetype, ct -> c_id, cachefile)
  3731. +         == NOTOK) {
  3732. +     advise (NULLCP, "unable to cache %s's contents", ct -> c_file);
  3733. +     return;
  3734. +     }
  3735. +     if (wcachesw != CACHE_NEVER && wcachesw != CACHE_ASK) {
  3736. +     (void) fflush (stdout);
  3737. +     fprintf (stderr, "caching message %s as file %s\n", ct -> c_file,
  3738. +          cachefile);
  3739. +     }
  3740. +     if (ce -> ce_file) {
  3741. +     int    mask = umask (cachetype ? ~m_gmprot () : 0222);
  3742. +     FILE   *fp;
  3743. +     if (debugsw)
  3744. +         fprintf (stderr, "caching by copying %s...\n", ce -> ce_file);
  3745. +     file = NULL;
  3746. +     if ((*ct -> c_ceopenfnx) (ct, &file) == NOTOK)
  3747. +         goto reset_umask;
  3748. +     if (fp = fopen (cachefile, "w")) {
  3749. +         int        cc;
  3750. +         char    buffer[BUFSIZ];
  3751. +         FILE   *gp = ce -> ce_fp;
  3752. +         (void) fseek (gp, 0L, 0);
  3753. +         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer, gp))
  3754. +                > 0)
  3755. +         (void) fwrite (buffer, sizeof *buffer, cc, fp);
  3756. +         (void) fflush (fp);
  3757. +         if (ferror (gp)) {
  3758. +         admonish (ce -> ce_file, "error reading");
  3759. +         (void) unlink (cachefile);
  3760. +         }
  3761. +         else
  3762. +         if (ferror (fp)) {
  3763. +             admonish (cachefile, "error writing");
  3764. +             (void) unlink (cachefile);
  3765. +         }
  3766. +         (void) fclose (fp);
  3767. +     }
  3768. +     else
  3769. +         content_error (cachefile, ct, "unable to fopen for writing");
  3770. + reset_umask: ;
  3771. +     (void) umask (mask);
  3772. +     }
  3773. +     else {
  3774. +     if (debugsw)
  3775. +         fprintf (stderr, "in place caching...\n");
  3776. +     file = cachefile;
  3777. +     if ((*ct -> c_ceopenfnx) (ct, &file) != NOTOK)
  3778. +         (void) chmod (cachefile, cachetype ? m_gmprot () : 0444);
  3779. +     }
  3780. + }
  3781.   /*     COMPOSITION */
  3782.   
  3783.   static    char    prefix[] = "----- =_aaaaaaaaaa";
  3784. ***************
  3785. *** 5045,5050 ****
  3786. --- 5660,5667 ----
  3787.       free_content (ct);
  3788.       free_ct = ct = p;
  3789.       }
  3790. +     else
  3791. +     set_id (ct, 1);
  3792.   
  3793.       if ((cp = index (prefix, 'a')) == NULL)
  3794.       adios (NULLCP, "internal error(4)");
  3795. ***************
  3796. *** 5153,5158 ****
  3797. --- 5770,5776 ----
  3798.       *ctp = ct;
  3799.       ci = &ct -> c_ctinfo;
  3800.       ct -> c_ctlistfnx = list_content;
  3801. +     set_id (ct, 0);
  3802.   
  3803.       if (buf[0] != '#' || buf[1] == '#' || buf[1] == '<') {
  3804.       int    headers,
  3805. ***************
  3806. *** 5241,5246 ****
  3807. --- 5859,5869 ----
  3808.           s2i++;
  3809.       switch (ct -> c_type = s2i -> si_value) {
  3810.           case CT_MESSAGE:
  3811. +             if (uleq (ci -> ci_subtype, "rfc822")) {
  3812. +             ct -> c_encoding = CE_7BIT;        /* XXX */
  3813. +             goto call_init;
  3814. +         }
  3815. +         /* else fall... */
  3816.           case CT_MULTIPART:
  3817.           adios (NULLCP,
  3818.                  "it makes sense to define a in-line %s content... NOT!",
  3819. ***************
  3820. *** 5248,5253 ****
  3821. --- 5871,5877 ----
  3822.           /* NOTREACHED */
  3823.   
  3824.           default:
  3825. + call_init: ;
  3826.           if (ct -> c_ctinitfnx = s2i -> si_init)
  3827.               (void) (*ct -> c_ctinitfnx) (ct);
  3828.               break;
  3829. ***************
  3830. *** 5282,5287 ****
  3831. --- 5906,5912 ----
  3832.           if (uleq (ci -> ci_subtype, "external-body"))
  3833.               adios (NULLCP, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"",
  3834.                  ci -> ci_type, ci -> ci_subtype);
  3835. + use_forw: ;
  3836.           adios (NULLCP,
  3837.                  "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"",
  3838.                  ci -> ci_type, ci -> ci_subtype);
  3839. ***************
  3840. *** 5294,5305 ****
  3841.       }
  3842.   
  3843.       if (extrnal) {
  3844. -         char    msgid[BUFSIZ];
  3845.           register struct exbody *e;
  3846.           CT        p;
  3847. -         static int    partno;
  3848. -         static long clock = 0L;
  3849. -         static char *msgfmt;
  3850.   
  3851.           if (!ci -> ci_magic)
  3852.           adios (NULLCP, "need external information for \"#@%s/%s\"",
  3853. --- 5919,5926 ----
  3854. ***************
  3855. *** 5334,5350 ****
  3856.           if (params_external (ct, 1) == NOTOK)
  3857.           done (1);
  3858.   
  3859. -         if (clock == 0L) {
  3860. -         (void) time (&clock);
  3861. -         (void) sprintf (msgid, "<%d.%ld.%%d@%s>\n", getpid (), clock,
  3862. -                 LocalName ());
  3863. -         partno = 0;
  3864. -         msgfmt = getcpy (msgid);
  3865. -         }
  3866. -         (void) sprintf (msgid, msgfmt, ++partno);
  3867. -         p -> c_id = getcpy (msgid);
  3868.           return OK;
  3869.       }
  3870.   
  3871. --- 5955,5960 ----
  3872. ***************
  3873. *** 5419,5436 ****
  3874.       free (folder);
  3875.   
  3876.       free_ctinfo (ct);
  3877. !     if (get_ctinfo ("multipart/digest", ct, 0) == NOTOK)
  3878. !         done (1);
  3879. !     ct -> c_type = CT_MULTIPART;
  3880. !     ct -> c_subtype = MULTI_DIGEST;
  3881. !     ct -> c_ctlistfnx = list_multi;
  3882. !     ct -> c_ctfreefnx = free_multi;
  3883.   
  3884. !     if ((m = (struct multipart *) calloc (1, sizeof *m)) == NULL)
  3885. !         adios (NULLCP, "out of memory");
  3886. !     ct -> c_ctparams = (caddr_t) m;
  3887.   
  3888. !     pp = &m -> mp_parts;
  3889.       for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++)
  3890.           if (mp -> msgstats[msgnum] & SELECTED) {
  3891.           register struct part *part;
  3892. --- 6029,6050 ----
  3893.       free (folder);
  3894.   
  3895.       free_ctinfo (ct);
  3896. !     if (mp -> numsel > 1) {
  3897. !         if (get_ctinfo ("multipart/digest", ct, 0) == NOTOK)
  3898. !         done (1);
  3899. !         ct -> c_type = CT_MULTIPART;
  3900. !         ct -> c_subtype = MULTI_DIGEST;
  3901. !         ct -> c_ctlistfnx = list_multi;
  3902. !         ct -> c_ctfreefnx = free_multi;
  3903.   
  3904. !         if ((m = (struct multipart *) calloc (1, sizeof *m)) == NULL)
  3905. !         adios (NULLCP, "out of memory");
  3906. !         ct -> c_ctparams = (caddr_t) m;
  3907.   
  3908. !         pp = &m -> mp_parts;
  3909. !     }
  3910. !     else
  3911. !         free_content (ct);
  3912.       for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++)
  3913.           if (mp -> msgstats[msgnum] & SELECTED) {
  3914.           register struct part *part;
  3915. ***************
  3916. *** 5449,5458 ****
  3917.           if (listsw && stat (p -> c_file, &st) != NOTOK)
  3918.               p -> c_end = (long) st.st_size;
  3919.   
  3920. !         if ((part = (struct part *) calloc (1, sizeof *part)) == NULL)
  3921. !             adios (NULLCP, "out of memory");
  3922. !         *pp = part, pp = &part -> mp_next;
  3923. !         part -> mp_part = p;
  3924.           }
  3925.   
  3926.       m_fmsg (mp);
  3927. --- 6063,6077 ----
  3928.           if (listsw && stat (p -> c_file, &st) != NOTOK)
  3929.               p -> c_end = (long) st.st_size;
  3930.   
  3931. !         if (mp -> numsel > 1) {
  3932. !             if ((part = (struct part *) calloc (1, sizeof *part))
  3933. !                 == NULL)
  3934. !             adios (NULLCP, "out of memory");
  3935. !             *pp = part, pp = &part -> mp_next;
  3936. !             part -> mp_part = p;
  3937. !         }
  3938. !         else
  3939. !             *ctp = ct = p;
  3940.           }
  3941.   
  3942.       m_fmsg (mp);
  3943. ***************
  3944. *** 5470,5480 ****
  3945.       adios (NULLCP, "unknown directive \"#%s\"", ci -> ci_type);
  3946.   
  3947.                       /* #begin [ alternative | parallel ] */
  3948. !     vrsn = !ci -> ci_magic ? MULTI_MIXED
  3949. !         : uprf (ci -> ci_magic, "alt") ? MULTI_ALTERNATE
  3950. !                            : MULTI_PARALLEL;
  3951.       free_ctinfo (ct);
  3952. !     (void) sprintf (buffer, "multipart/%s", SubMultiPart[vrsn - 1].kv_key);
  3953.       if (get_ctinfo (buffer, ct, 0) == NOTOK)
  3954.       done (1);
  3955.       ct -> c_type = CT_MULTIPART;
  3956. --- 6089,6109 ----
  3957.       adios (NULLCP, "unknown directive \"#%s\"", ci -> ci_type);
  3958.   
  3959.                       /* #begin [ alternative | parallel ] */
  3960. !     if (!ci -> ci_magic)
  3961. !     cp = SubMultiPart[(vrsn = MULTI_MIXED) - 1].kv_key;
  3962. !     else
  3963. !     if (uleq (ci -> ci_magic, "alternative"))
  3964. !         cp = SubMultiPart[(vrsn = MULTI_ALTERNATE) - 1].kv_key;
  3965. !     else
  3966. !         if (uleq (ci -> ci_magic, "parallel"))
  3967. !         cp = SubMultiPart[(vrsn = MULTI_PARALLEL) - 1].kv_key;
  3968. !     else
  3969. !         if (uprf (ci -> ci_magic, "digest"))
  3970. !         goto use_forw;
  3971. !         else
  3972. !         cp = ci -> ci_magic, vrsn = MULTI_UNKNOWN;
  3973.       free_ctinfo (ct);
  3974. !     (void) sprintf (buffer, "multipart/%s", cp);
  3975.       if (get_ctinfo (buffer, ct, 0) == NOTOK)
  3976.       done (1);
  3977.       ct -> c_type = CT_MULTIPART;
  3978. ***************
  3979. *** 5510,5515 ****
  3980. --- 6139,6166 ----
  3981.   
  3982.   /*   */
  3983.   
  3984. + static void set_id (ct, top)
  3985. + CT    ct;
  3986. + int    top;
  3987. + {
  3988. +     char    msgid[BUFSIZ];
  3989. +     static int  partno;
  3990. +     static long clock = 0L;
  3991. +     static char *msgfmt;
  3992. +     if (clock == 0L) {
  3993. +     (void) time (&clock);
  3994. +     (void) sprintf (msgid, "<%d.%ld.%%d@%s>\n", getpid (), clock,
  3995. +             LocalName ());
  3996. +     partno = 0;
  3997. +     msgfmt = getcpy (msgid);
  3998. +     }
  3999. +     (void) sprintf (msgid, msgfmt, top ? 0 : ++partno);
  4000. +     ct -> c_id = getcpy (msgid);
  4001. + }
  4002. + /*   */
  4003.   static char ebcdicsafe[0x100] = {
  4004.       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4005.       0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
  4006. ***************
  4007. *** 5905,5911 ****
  4008.           (void) putc (' ', out);
  4009.           len++;
  4010.       }
  4011. !     fprintf (out, "%s", buffer);
  4012.       len += cc;
  4013.       }
  4014.       if (ci -> ci_comment) {
  4015. --- 6556,6562 ----
  4016.           (void) putc (' ', out);
  4017.           len++;
  4018.       }
  4019. !     fputs (buffer, out);
  4020.       len += cc;
  4021.       }
  4022.       if (ci -> ci_comment) {
  4023. ***************
  4024. *** 5920,5926 ****
  4025.       fprintf (out, "(%s)", ci -> ci_comment);
  4026.       len += cc;
  4027.       }
  4028. !     fprintf (out, "\n");
  4029.       if (ct -> c_id)
  4030.       fprintf (out, "%s: %s", ID_FIELD, ct -> c_id);
  4031.       if (ct -> c_descr)
  4032. --- 6571,6577 ----
  4033.       fprintf (out, "(%s)", ci -> ci_comment);
  4034.       len += cc;
  4035.       }
  4036. !     (void) putc ('\n', out);
  4037.       if (ct -> c_id)
  4038.       fprintf (out, "%s: %s", ID_FIELD, ct -> c_id);
  4039.       if (ct -> c_descr)
  4040. ***************
  4041. *** 5936,5942 ****
  4042.           register struct part *part;
  4043.   
  4044.           if (ct -> c_rfc934)
  4045. !             fprintf (out, "\n");
  4046.   
  4047.           for (part = m -> mp_parts; part; part = part -> mp_next) {
  4048.               register CT  p = part -> mp_part;
  4049. --- 6587,6593 ----
  4050.           register struct part *part;
  4051.   
  4052.           if (ct -> c_rfc934)
  4053. !             (void) putc ('\n', out);
  4054.   
  4055.           for (part = m -> mp_parts; part; part = part -> mp_next) {
  4056.               register CT  p = part -> mp_part;
  4057. ***************
  4058. *** 5965,5986 ****
  4059.           (void) writeQuoted (ct, out);
  4060.           break;
  4061.           }
  4062. !         if (ct -> c_subtype != TEXT_PLAIN && ct -> c_encoding != CE_7BIT)
  4063.           goto quoted_printable;
  4064. -         if (checksw)
  4065. -         goto quoted_printable;
  4066.           /* else fall... */
  4067.   
  4068.       case CT_MESSAGE:
  4069.   seven_bit: ;
  4070. !         fprintf (out, "\n");
  4071.           if (ct -> c_type == CT_MESSAGE
  4072.               && ct -> c_subtype == MESSAGE_EXTERNAL) {
  4073.           register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  4074.           
  4075.           (void) output_content (e -> eb_content, out);
  4076. !         if (e -> eb_body)
  4077. !             fprintf (out, "\n%s\n", e -> eb_body);
  4078.           }
  4079.           else
  4080.           (void) write7Bit (ct, out);
  4081. --- 6616,6699 ----
  4082.           (void) writeQuoted (ct, out);
  4083.           break;
  4084.           }
  4085. !         if ((ct -> c_subtype != TEXT_PLAIN && ct -> c_encoding != CE_7BIT)
  4086. !             || checksw)
  4087.           goto quoted_printable;
  4088.           /* else fall... */
  4089.   
  4090.       case CT_MESSAGE:
  4091.   seven_bit: ;
  4092. !         (void) putc ('\n', out);
  4093.           if (ct -> c_type == CT_MESSAGE
  4094.               && ct -> c_subtype == MESSAGE_EXTERNAL) {
  4095.           register struct exbody *e = (struct exbody *) ct -> c_ctparams;
  4096.           
  4097.           (void) output_content (e -> eb_content, out);
  4098. !         if (e -> eb_body) {
  4099. !             register char   *cp;
  4100. !             putc ('\n', out);
  4101. !             for (cp = e -> eb_body; *cp; cp++) {
  4102. !             CT    ct2 = e -> eb_content;
  4103. !             CI    ci2 = &ct2 -> c_ctinfo;
  4104. !             if (*cp == '\\')
  4105. !                 switch (*++cp) {
  4106. !                 case 'I':
  4107. !                     if (ct2 -> c_id) {
  4108. !                     char *dp = trimcpy (ct2 -> c_id);
  4109. !                     
  4110. !                     (void) fputs (dp, out);
  4111. !                     free (dp);
  4112. !                     }
  4113. !                     continue;
  4114. !                 case 'N':
  4115. !                     for (ap = ci2 -> ci_attrs,
  4116. !                          ep = ci2 -> ci_values;
  4117. !                          *ap;
  4118. !                          ap++, ep++)
  4119. !                     if (uleq (*ap, "name")) {
  4120. !                         fprintf (out, "%s", *ep);
  4121. !                         break;
  4122. !                     }
  4123. !                     continue;
  4124. !                         
  4125. !                 case 'T':
  4126. !                     fprintf (out, "%s/%s", ci2 -> ci_type,
  4127. !                          ci2 -> ci_subtype);
  4128. !                     for (ap = ci2 -> ci_attrs,
  4129. !                          ep = ci2 -> ci_values;
  4130. !                          *ap;
  4131. !                          ap++, ep++)
  4132. !                     fprintf (out, "; %s=\"%s\"", *ap, *ep);
  4133. !                     continue;
  4134. !                 case 'n':
  4135. !                     (void) putc ('\n', out);
  4136. !                     continue;
  4137. !                 case 't':
  4138. !                     (void) putc ('\t', out);
  4139. !                     continue;
  4140. !                 case '\0':
  4141. !                     cp--;
  4142. !                     break;
  4143. !                 case '\\':
  4144. !                 case '"':
  4145. !                     break;
  4146. !                 default:
  4147. !                     (void) putc ('\\', out);
  4148. !                     break;
  4149. !                 }
  4150. !             (void) putc (*cp, out);
  4151. !             }
  4152. !             putc ('\n', out);
  4153. !         }
  4154.           }
  4155.           else
  4156.           (void) write7Bit (ct, out);
  4157. ***************
  4158. *** 6072,6078 ****
  4159.               break;
  4160.   
  4161.           default:
  4162. !             if (ebcdicsw && !ebcdicsafe[*cp & 0xff])
  4163.               goto three_print;
  4164.               (void) putc (*cp, out);
  4165.               n++;
  4166. --- 6785,6793 ----
  4167.               break;
  4168.   
  4169.           default:
  4170. !             if (*cp < '!'
  4171. !                 || *cp > '~'
  4172. !                 || (ebcdicsw && !ebcdicsafe[*cp & 0xff]))
  4173.               goto three_print;
  4174.               (void) putc (*cp, out);
  4175.               n++;
  4176. *** ../mh-6.8.2/uip/mhparam.c    Wed Aug 25 15:56:38 1993
  4177. --- uip/mhparam.c    Wed Sep  1 16:01:13 1993
  4178. ***************
  4179. *** 1,6 ****
  4180.   /* mhparam.c - print mh_profile values */
  4181.   #ifndef    lint
  4182. ! static char ident[] = "@(#)$Id: mhparam.c,v 1.7 1992/12/15 00:20:22 jromine Exp $";
  4183.   #endif    /* lint */
  4184.   /* contributed by Jeffrey C Honig <Jeffrey_C_Honig@cornell.edu> */
  4185.   
  4186. --- 1,6 ----
  4187.   /* mhparam.c - print mh_profile values */
  4188.   #ifndef    lint
  4189. ! static char ident[] = "@(#)$Id: mhparam.c,v 1.9 1993/09/01 23:00:59 jromine Exp $";
  4190.   #endif    /* lint */
  4191.   /* contributed by Jeffrey C Honig <Jeffrey_C_Honig@cornell.edu> */
  4192.   
  4193. ***************
  4194. *** 7,12 ****
  4195. --- 7,16 ----
  4196.   #include "../h/mh.h"
  4197.   #include <stdio.h>
  4198.   
  4199. + extern char *mhlibdir;        /* NB: this will change soon */
  4200. + char *sbackup = SBACKUP;
  4201. + char *slink = LINK;
  4202.   /*   */
  4203.   
  4204.   static struct swit switches[] = {
  4205. ***************
  4206. *** 151,156 ****
  4207. --- 155,164 ----
  4208.        { "vmhproc",    &vmhproc    },
  4209.        { "whatnowproc",    &whatnowproc    },
  4210.        { "whomproc",    &whomproc    },
  4211. +      { "libdir",    &mhlibdir       },
  4212. +      { "sbackup",       &sbackup        },
  4213. +      { "link",          &slink          },
  4214.        { NULL, NULL },
  4215.   };
  4216.   
  4217. *** ../mh-6.8.2/uip/msgchk.c    Wed Aug 25 15:56:41 1993
  4218. --- uip/msgchk.c    Wed Sep  1 14:44:46 1993
  4219. ***************
  4220. *** 1,6 ****
  4221.   /* msgchk.c - check for mail */
  4222.   #ifndef    lint
  4223. ! static char ident[] = "@(#)$Id: msgchk.c,v 1.12 1993/08/20 15:52:41 jromine Exp $";
  4224.   #endif    /* lint */
  4225.   
  4226.   #include "../h/mh.h"
  4227. --- 1,6 ----
  4228.   /* msgchk.c - check for mail */
  4229.   #ifndef    lint
  4230. ! static char ident[] = "@(#)$Id: msgchk.c,v 1.13 1993/09/01 21:44:19 jromine Exp $";
  4231.   #endif    /* lint */
  4232.   
  4233.   #include "../h/mh.h"
  4234. ***************
  4235. *** 200,224 ****
  4236.   
  4237.   /*   */
  4238.   #ifdef    POP
  4239.   #ifdef HESIOD
  4240. !     /*
  4241. !       * Scheme is:
  4242. !       *        use MAILHOST environment variable if present,
  4243. !       *  else try Hesiod.
  4244. !       *  If that fails, use the default (if any)
  4245. !       *  provided by mtstailor in mts_init()
  4246. !       */
  4247. !     if (pophost == NULL || pophost[0] == '\0')
  4248. !       {
  4249.       if ((tmphost = getenv("MAILHOST")) != NULL)
  4250. !       pophost = tmphost;
  4251.       else if ((po = hes_getmailhost(vecp ? vec[0] : user)) != NULL &&
  4252. !          strcmp(po->po_type, "POP") == 0)
  4253. !       pophost = po->po_host;
  4254. !       }
  4255.   #endif /* HESIOD */
  4256. !     if (pophost && *pophost)
  4257. !     host = pophost;
  4258.       if (!host || !*host)
  4259.       host = NULL;
  4260.       if (!host || rpop <= 0)
  4261. --- 200,223 ----
  4262.   
  4263.   /*   */
  4264.   #ifdef    POP
  4265. +     if (!host || !*host) {    /* -host not specified by user */
  4266.   #ifdef HESIOD
  4267. !     /*
  4268. !      * Scheme is:
  4269. !      *        use MAILHOST environment variable if present,
  4270. !      *  else try Hesiod.
  4271. !      *  If that fails, use the default (if any)
  4272. !      *  provided by mtstailor in mts_init()
  4273. !      */
  4274.       if ((tmphost = getenv("MAILHOST")) != NULL)
  4275. !         pophost = tmphost;
  4276.       else if ((po = hes_getmailhost(vecp ? vec[0] : user)) != NULL &&
  4277. !         strcmp(po->po_type, "POP") == 0)
  4278. !         pophost = po->po_host;
  4279.   #endif /* HESIOD */
  4280. !     if (pophost && *pophost)
  4281. !         host = pophost;
  4282. !     }
  4283.       if (!host || !*host)
  4284.       host = NULL;
  4285.       if (!host || rpop <= 0)
  4286. *** ../mh-6.8.2/uip/msh.c    Wed Aug 25 15:56:34 1993
  4287. --- uip/msh.c    Thu Aug 26 11:25:31 1993
  4288. ***************
  4289. *** 1,6 ****
  4290.   /* msh.c - The MH shell (sigh) */
  4291.   #ifndef    lint
  4292. ! static char ident[] = "@(#)$Id: msh.c,v 2.13 1992/12/15 00:20:22 jromine Exp jromine $";
  4293.   #endif    /* lint */
  4294.   
  4295.   /* TODO:
  4296. --- 1,6 ----
  4297.   /* msh.c - The MH shell (sigh) */
  4298.   #ifndef    lint
  4299. ! static char ident[] = "@(#)$Id: msh.c,v 2.13 1992/12/15 00:20:22 jromine Exp $";
  4300.   #endif    /* lint */
  4301.   
  4302.   /* TODO:
  4303. *** ../mh-6.8.2/uip/mshcmds.c    Wed Aug 25 15:56:37 1993
  4304. --- uip/mshcmds.c    Tue Nov 30 19:50:38 1993
  4305. ***************
  4306. *** 1,6 ****
  4307.   /* mshcmds.c - command handlers in msh */
  4308.   #ifndef    lint
  4309. ! static char ident[] = "@(#)$Id: mshcmds.c,v 1.25 1992/12/15 00:20:22 jromine Exp jromine $";
  4310.   #endif    /* lint */
  4311.   
  4312.   #include "../h/mh.h"
  4313. --- 1,6 ----
  4314.   /* mshcmds.c - command handlers in msh */
  4315.   #ifndef    lint
  4316. ! static char ident[] = "@(#)$Id: mshcmds.c,v 1.28 1993/12/01 03:50:31 jromine Exp $";
  4317.   #endif    /* lint */
  4318.   
  4319.   #include "../h/mh.h"
  4320. ***************
  4321. *** 2708,2714 ****
  4322.           state;
  4323.       register char   *bp,
  4324.               *dp;
  4325. !     char   *cp,
  4326.           buf[BUFSIZ],
  4327.           name[NAMESZ];
  4328.       FILE   *fp;
  4329. --- 2708,2715 ----
  4330.           state;
  4331.       register char   *bp,
  4332.               *dp;
  4333. !     char   *chset,
  4334. !        *cp,
  4335.           buf[BUFSIZ],
  4336.           name[NAMESZ];
  4337.       FILE   *fp;
  4338. ***************
  4339. *** 2719,2724 ****
  4340. --- 2720,2728 ----
  4341.   
  4342.       fp = msh_ready (msgnum, 1);
  4343.   
  4344. +     if (!(chset = getenv ("MM_CHARSET")))
  4345. +     chset = "us-ascii";
  4346.       for (state = FLD;;)
  4347.       switch (state = m_getfld (state, name, buf, sizeof buf, fp)) {
  4348.           case FLD:
  4349. ***************
  4350. *** 2793,2809 ****
  4351.               while (isspace (*dp))
  4352.                   dp++;
  4353.               if (*dp == '"') {
  4354. !                 dp++;
  4355. !                 if (strlen (dp) >= sizeof "us-ascii\""
  4356. !                     && *(bp = dp + sizeof "us-ascii" - 1)=='"')
  4357.                   *bp = NULL;
  4358.               }
  4359.               else
  4360. !                 if (strlen (dp) >= sizeof "us-ascii"
  4361. !                     && isspace (*(bp =
  4362. !                         dp + sizeof "us-ascii" - 1)))
  4363. !                 *bp = NULL;
  4364. !             result = !uleq (dp, "us-ascii");
  4365.               }
  4366.               else
  4367.               if (!(result = !uleq (bp, "text"))) {
  4368. --- 2797,2815 ----
  4369.               while (isspace (*dp))
  4370.                   dp++;
  4371.               if (*dp == '"') {
  4372. !                 if (bp = index (++dp, '"'))
  4373.                   *bp = NULL;
  4374.               }
  4375.               else
  4376. !                 for (bp = dp; *bp; bp++)
  4377. !                 if (isspace (*bp)) {
  4378. !                     *bp = NULL;
  4379. !                     break;
  4380. !                 }
  4381. !             if ((result = !uleq (dp, chset))
  4382. !                     && uleq (dp, "us-ascii")
  4383. !                     && uleq (chset, "iso-8859-1"))
  4384. !                 result = 0;
  4385.               }
  4386.               else
  4387.               if (!(result = !uleq (bp, "text"))) {
  4388. ***************
  4389. *** 2833,2840 ****
  4390.               for (dp = bp; istoken (*dp); dp++)
  4391.               continue;
  4392.               *dp = NULL;
  4393. !             if (result = !uleq (bp, "7bit"))
  4394. !                 Msgs[msgnum].m_flags |= MHNYES;
  4395.   
  4396.               free (cp);
  4397.               if (result) {
  4398. --- 2839,2847 ----
  4399.               for (dp = bp; istoken (*dp); dp++)
  4400.               continue;
  4401.               *dp = NULL;
  4402. !             result = !uleq (bp, "7bit")
  4403. !                 && !uleq (bp, "8bit")
  4404. !                 && !uleq (bp, "binary");
  4405.   
  4406.               free (cp);
  4407.               if (result) {
  4408. *** ../mh-6.8.2/uip/popsbr.c    Wed Aug 25 15:56:34 1993
  4409. --- uip/popsbr.c    Thu Aug 26 11:26:07 1993
  4410. ***************
  4411. *** 1,6 ****
  4412.   /* popsbr.c - POP client subroutines */
  4413.   #ifndef    lint
  4414. ! static char ident[] = "@(#)$Id: popsbr.c,v 2.5 1993/08/25 17:26:40 jromine Exp $";
  4415.   #endif    lint
  4416.   
  4417.   #if defined(NNTP) && !defined(PSHSBR)
  4418. --- 1,6 ----
  4419.   /* popsbr.c - POP client subroutines */
  4420.   #ifndef    lint
  4421. ! static char ident[] = "@(#)$Id: popsbr.c,v 2.6 1993/08/26 18:25:52 jromine Exp $";
  4422.   #endif    lint
  4423.   
  4424.   #if defined(NNTP) && !defined(PSHSBR)
  4425. ***************
  4426. *** 198,205 ****
  4427.   #endif
  4428.           }
  4429.   #else    /* NNTP */
  4430. !         if (*response < CHAR_ERR)
  4431.           return OK;
  4432.   #endif
  4433.           (void) strcpy (buffer, response);
  4434.           (void) command ("QUIT");
  4435. --- 198,207 ----
  4436.   #endif
  4437.           }
  4438.   #else    /* NNTP */
  4439. !         if (*response < CHAR_ERR) {
  4440. !         (void) command ("MODE READER");
  4441.           return OK;
  4442. +         }
  4443.   #endif
  4444.           (void) strcpy (buffer, response);
  4445.           (void) command ("QUIT");
  4446. ***************
  4447. *** 302,309 ****
  4448. --- 304,316 ----
  4449.   int    pop_exists (action)
  4450.   int    (*action) ();
  4451.   {
  4452. + #ifdef    XMSGS        /* hacked into NNTP 1.5 */
  4453.       if (traverse (action, "XMSGS %d-%d",
  4454.           (targ_t)xtnd_first, (targ_t)xtnd_last, 0, 0) == OK)
  4455. +     return OK;
  4456. + #endif
  4457. +     if (traverse (action, "LISTGROUP",    /* provided by INN 1.4 */
  4458. +         0, 0, 0, 0) == OK)
  4459.       return OK;
  4460.       return traverse (action, "XHDR NONAME %d-%d",
  4461.           (targ_t)xtnd_first, (targ_t)xtnd_last, 0, 0);
  4462. *** ../mh-6.8.2/uip/pshsbr.c    Wed Aug 25 15:56:34 1993
  4463. --- uip/pshsbr.c    Thu Aug 26 11:26:07 1993
  4464. ***************
  4465. *** 1,6 ****
  4466.   /* popsbr.c - POP client subroutines */
  4467.   #ifndef    lint
  4468. ! static char ident[] = "@(#)$Id: popsbr.c,v 2.5 1993/08/25 17:26:40 jromine Exp $";
  4469.   #endif    lint
  4470.   
  4471.   #if defined(NNTP) && !defined(PSHSBR)
  4472. --- 1,6 ----
  4473.   /* popsbr.c - POP client subroutines */
  4474.   #ifndef    lint
  4475. ! static char ident[] = "@(#)$Id: popsbr.c,v 2.6 1993/08/26 18:25:52 jromine Exp $";
  4476.   #endif    lint
  4477.   
  4478.   #if defined(NNTP) && !defined(PSHSBR)
  4479. ***************
  4480. *** 198,205 ****
  4481.   #endif
  4482.           }
  4483.   #else    /* NNTP */
  4484. !         if (*response < CHAR_ERR)
  4485.           return OK;
  4486.   #endif
  4487.           (void) strcpy (buffer, response);
  4488.           (void) command ("QUIT");
  4489. --- 198,207 ----
  4490.   #endif
  4491.           }
  4492.   #else    /* NNTP */
  4493. !         if (*response < CHAR_ERR) {
  4494. !         (void) command ("MODE READER");
  4495.           return OK;
  4496. +         }
  4497.   #endif
  4498.           (void) strcpy (buffer, response);
  4499.           (void) command ("QUIT");
  4500. ***************
  4501. *** 302,309 ****
  4502. --- 304,316 ----
  4503.   int    pop_exists (action)
  4504.   int    (*action) ();
  4505.   {
  4506. + #ifdef    XMSGS        /* hacked into NNTP 1.5 */
  4507.       if (traverse (action, "XMSGS %d-%d",
  4508.           (targ_t)xtnd_first, (targ_t)xtnd_last, 0, 0) == OK)
  4509. +     return OK;
  4510. + #endif
  4511. +     if (traverse (action, "LISTGROUP",    /* provided by INN 1.4 */
  4512. +         0, 0, 0, 0) == OK)
  4513.       return OK;
  4514.       return traverse (action, "XHDR NONAME %d-%d",
  4515.           (targ_t)xtnd_first, (targ_t)xtnd_last, 0, 0);
  4516. *** ../mh-6.8.2/uip/replsbr.c    Wed Aug 25 15:56:26 1993
  4517. --- uip/replsbr.c    Sat Sep  4 12:31:54 1993
  4518. ***************
  4519. *** 1,6 ****
  4520.   /* replsbr.c - routines to help repl along... */
  4521.   #ifndef    lint
  4522. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.15 1993/08/25 17:27:35 jromine Exp $";
  4523.   #endif    /* lint */
  4524.   
  4525.   #include "../h/mh.h"
  4526. --- 1,6 ----
  4527.   /* replsbr.c - routines to help repl along... */
  4528.   #ifndef    lint
  4529. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.17 1993/09/04 19:31:32 jromine Exp $";
  4530.   #endif    /* lint */
  4531.   
  4532.   #include "../h/mh.h"
  4533. ***************
  4534. *** 8,13 ****
  4535. --- 8,15 ----
  4536.   #include "../h/formatsbr.h"
  4537.   #include <ctype.h>
  4538.   #include <stdio.h>
  4539. + #include <sys/types.h>        /* off_t */
  4540. + #include <sys/file.h>        /* L_SET */
  4541.   
  4542.   
  4543.   extern short    ccto,        /* from repl.c */
  4544. ***************
  4545. *** 411,416 ****
  4546. --- 413,419 ----
  4547.       mhl = r1bindex (mhlproc, '/');
  4548.   
  4549.       rewind (in);
  4550. +     (void) lseek (fileno(in), (off_t)0, L_SET);
  4551.       (void) fflush (out);
  4552.   
  4553.       switch (pid = vfork ()) {
  4554. ***************
  4555. *** 422,431 ****
  4556.           (void) dup2 (fileno (out), fileno (stdout));
  4557.           closefds (3);
  4558.   
  4559. - #ifdef _FSTDIO
  4560. -         /* <sigh> the code assumed that rewind does this. */
  4561. -         (void) lseek (fileno(stdin), (off_t)0, SEEK_SET);
  4562. - #endif
  4563.           execlp (mhlproc, mhl, "-form", filter, "-noclear", NULLCP);
  4564.           fprintf (stderr, "unable to exec ");
  4565.           perror (mhlproc);
  4566. --- 425,430 ----
  4567. *** ../mh-6.8.2/uip/show.c    Wed Aug 25 15:56:35 1993
  4568. --- uip/show.c    Tue Oct 26 13:09:41 1993
  4569. ***************
  4570. *** 1,6 ****
  4571.   /* show.c - list messages */
  4572.   #ifndef    lint
  4573. ! static char ident[] = "@(#)$Id: show.c,v 1.12 1992/12/15 00:20:22 jromine Exp $";
  4574.   #endif    /* lint */
  4575.   
  4576.   #include "../h/mh.h"
  4577. --- 1,6 ----
  4578.   /* show.c - list messages */
  4579.   #ifndef    lint
  4580. ! static char ident[] = "@(#)$Id: show.c,v 1.14 1993/10/26 20:09:21 jromine Exp $";
  4581.   #endif    /* lint */
  4582.   
  4583.   #include "../h/mh.h"
  4584. ***************
  4585. *** 336,342 ****
  4586.           state;
  4587.       register char   *bp,
  4588.               *dp;
  4589. !     char   *cp,
  4590.           buf[BUFSIZ],
  4591.           name[NAMESZ];
  4592.       FILE   *fp;
  4593. --- 336,343 ----
  4594.           state;
  4595.       register char   *bp,
  4596.               *dp;
  4597. !     char   *chset,
  4598. !        *cp,
  4599.           buf[BUFSIZ],
  4600.           name[NAMESZ];
  4601.       FILE   *fp;
  4602. ***************
  4603. *** 344,349 ****
  4604. --- 345,353 ----
  4605.       if ((fp = fopen (msgnam, "r")) == NULL)
  4606.       return 0;
  4607.   
  4608. +     if (!(chset = getenv ("MM_CHARSET")))
  4609. +     chset = "us-ascii";
  4610.       for (state = FLD;;)
  4611.       switch (state = m_getfld (state, name, buf, sizeof buf, fp)) {
  4612.           case FLD:
  4613. ***************
  4614. *** 418,434 ****
  4615.               while (isspace (*dp))
  4616.                   dp++;
  4617.               if (*dp == '"') {
  4618. !                 dp++;
  4619. !                 if (strlen (dp) >= sizeof "us-ascii\""
  4620. !                     && *(bp = dp + sizeof "us-ascii" - 1)=='"')
  4621.                   *bp = NULL;
  4622.               }
  4623.               else
  4624. !                 if (strlen (dp) >= sizeof "us-ascii"
  4625. !                     && isspace (*(bp =
  4626. !                         dp + sizeof "us-ascii" - 1)))
  4627. !                 *bp = NULL;
  4628. !             result = !uleq (dp, "us-ascii");
  4629.               }
  4630.               else
  4631.               if (!(result = !uleq (bp, "text"))) {
  4632. --- 422,440 ----
  4633.               while (isspace (*dp))
  4634.                   dp++;
  4635.               if (*dp == '"') {
  4636. !                 if (bp = index (++dp, '"'))
  4637.                   *bp = NULL;
  4638.               }
  4639.               else
  4640. !                 for (bp = dp; *bp; bp++)
  4641. !                 if (isspace (*bp)) {
  4642. !                     *bp = NULL;
  4643. !                     break;
  4644. !                 }
  4645. !             if ((result = !uleq (dp, chset))
  4646. !                     && uleq (dp, "us-ascii")
  4647. !                     && uleq (chset, "iso-8859-1"))
  4648. !                 result = 0;
  4649.               }
  4650.               else
  4651.               if (!(result = !uleq (bp, "text"))) {
  4652. ***************
  4653. *** 457,463 ****
  4654.               for (dp = bp; istoken (*dp); dp++)
  4655.               continue;
  4656.               *dp = NULL;
  4657. !             result = !uleq (bp, "7bit");
  4658.   
  4659.               free (cp);
  4660.               if (result) {
  4661. --- 463,471 ----
  4662.               for (dp = bp; istoken (*dp); dp++)
  4663.               continue;
  4664.               *dp = NULL;
  4665. !             result = !uleq (bp, "7bit")
  4666. !                 && !uleq (bp, "8bit")
  4667. !                 && !uleq (bp, "binary");
  4668.   
  4669.               free (cp);
  4670.               if (result) {
  4671. *** ../mh-6.8.2/zotnet/mts.h    Wed Aug 25 15:56:08 1993
  4672. --- zotnet/mts.h    Sat Sep  4 12:09:48 1993
  4673. ***************
  4674. *** 1,5 ****
  4675.   /* mts.h - definitions for the mail system */
  4676. ! /* @(#)$Id: mts.h,v 1.3 1992/12/15 00:20:22 jromine Exp $ */
  4677.   
  4678.   
  4679.   /* Local and UUCP Host Name */
  4680. --- 1,5 ----
  4681.   /* mts.h - definitions for the mail system */
  4682. ! /* @(#)$Id: mts.h,v 1.4 1993/09/04 19:09:45 jromine Exp $ */
  4683.   
  4684.   
  4685.   /* Local and UUCP Host Name */
  4686. ***************
  4687. *** 84,89 ****
  4688. --- 84,90 ----
  4689.   
  4690.   extern char *servers;
  4691.   extern char *pophost;
  4692. + extern char *clientname;
  4693.   
  4694.   
  4695.   /* BBoards-specific variables */
  4696. *** ../mh-6.8.2/zotnet/mts/mts.h    Wed Aug 25 15:56:16 1993
  4697. --- zotnet/mts/mts.h    Wed Sep  1 13:55:11 1993
  4698. ***************
  4699. *** 81,86 ****
  4700. --- 81,87 ----
  4701.   
  4702.   /* SMTP/POP stuff */
  4703.   
  4704. + extern char *clientname;
  4705.   extern char *servers;
  4706.   extern char *pophost;
  4707.   
  4708. *** ../mh-6.8.2/zotnet/tws/lexedit.sed    Wed Aug 25 15:56:10 1993
  4709. --- zotnet/tws/lexedit.sed    Mon Oct 25 12:35:11 1993
  4710. ***************
  4711. *** 4,7 ****
  4712.   /^struct yysvf \*yyestate;$/,/^extern struct yysvf yysvec/d
  4713. ! /^# define YYNEWLINE /,/^int nstr;/d
  4714. ! /^while((nstr = yylook()/,/^if(yywrap()) /d
  4715.   /^case -1:$/,/^} return(0); }/c\
  4716. --- 4,7 ----
  4717.   /^struct yysvf \*yyestate;$/,/^extern struct yysvf yysvec/d
  4718. ! /^# define YYNEWLINE /,/^[     ]*int nstr;/d
  4719. ! /^[     ]*while((nstr = yylook()/,/^[     ]*if(yywrap()) /d
  4720.   /^case -1:$/,/^} return(0); }/c\
  4721.